Giter VIP home page Giter VIP logo

apptool-ios-sdk's Introduction

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Alamofire into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'ApsisOne', '~> 0.8'

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.

To install AppTool package into your packages, add it to the dependencies value of your Package.swift:

dependencies: [
    .package(url: "https://github.com/ApsisInternational/apptool-ios-sdk.git", .upToNextMajor(from: "0.8.1"))
]

To install AppTool package via Xcode

Data collection

To start collecting and sending any events like users’ behaviour data, custom events which you implement, location tracking, etc. You should provide data collection consent using provideConsent: method

Objective-C

[ApsisOneAPI provideConsent:ONEConsentTypeCollectData];

Swift

ApsisOneAPI.provide(.collectData)

Location collection

To track user’s location data:

  • Add description of location collection in Info.plist file
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>Track Your location to improve something</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>Track Your location to improve something</string>
  • Your app should request user’s authorization to use location services using ordinary CLLocationManager API (Preferred to use requestAlwaysAuthorization in case to collect location data in background):

Objective-C

[CLLocationManager.new requestAlwaysAuthorization];

Swift

CLLocationManager().requestAlwaysAuthorization()
  • In addition to data collection consent, you should provide location collection consent using provideConsent: method

Objective-C

[ApsisOneAPI provideConsent:ONEConsentTypeCollectLocation];

Swift

ApsisOneAPI.provide(.collectLocation)

To let framework collecting location in background, even application was closed, add location to allowed background modes in Info.plist

	<key>UIBackgroundModes</key>
	<array>
		<string>location</string>
	</array>

or Target -> Signing & Capabilities -> Background modes -> Location updates

Push Notifications

To allow sending push notifications you have to subscribe on topics using subscribePushNotificationTopics: method e.g.:

Objective-C

[ApsisOneAPI subscribePushNotificationTopics:@[@"some.consent.topic.discriminator"]];

Swift

ApsisOneAPI.subscribePushNotificationTopics(["some.consent.topic.discriminator"])

To stop receiving topic notifications use unsubscribe method, e.g.:

Objective-C

[ApsisOneAPI unsubscribePushNotificationTopics:@[@"some.consent.topic.discriminator"]];

Swift

ApsisOneAPI.unsubscribePushNotificationTopics(["some.consent.topic.discriminator"])

If there was no request for user's permission for push notifications yet, SDK will ask user for permission on first subscription call.

To let framework process and show notification add remote-notification to allowed background modes in Info.plist

    <key>UIBackgroundModes</key>
    <array>
        <string>remote-notification</string>
    </array>

or Target -> Signing & Capabilities -> Background modes -> Remote Notifications

Documentation

Documentation for the project can be found here

apptool-ios-sdk's People

Contributors

abouariu-efficy avatar apsis-rostov-ci avatar danillla avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.