iOS – Integrating the SDK

To integrate Point SDK, please request a demo for a Bluedot account here. The SDK works with iOS 10 and above.

Bluedot Point SDK enables an ‘always-on’ geolocation capability for apps by delivering accurate location awareness, while substantially reducing battery consumption compared to Core Location or other standard methods. Point SDK connects to Bluedot’s backend system, Canvas, to download your pre-configured Geofences, GEOLINE™, Bluetooth Beacons, conditions, and actions.

Point SDK enables rapid development of location-aware apps. It delivers precise location awareness to the mobile application, without the battery drain that would typically occur. It requires no additional hardware, making it highly scalable.

Point SDK enables you to provide next-generation experiences on your location-based app.

Importing Point SDK

You can either install PointSDK via CocoaPods or Carthage by adding BluedotPointSDK dependency.

Configure info.plist settings

To address differences in hardware capability of iOS devices, Apple has implemented a scheme of string-keys for apps to declare the hardware features it requires. These are stored in a file named info.plist. Running an app on an iOS device with insufficient hardware support may crash the app or result in a degraded experience. Declaring the required hardware features within info.plist allows iOS, and the AppStore, to identify in advance whether a given device should even attempt to download and execute the app.

Further information on this can be found here:

  1. Requiring the Presence of Location Services in an iOS App
  2. info.plist iOS Keys Reference

Source Code

⚠️ In order to use enhanced restart mode, the following code MUST BE located in AppDelegate. As per iOS lifecycle, during an app restart after termination, the app WILL NOT initialise views.

  • Implement the BDPSessionDelegate and BDPLocationDelegate protocols.
  • Assign an object implementing the protocols to a class (for example, AppDelegate)

    // Swift
    BDLocationManager.instance().sessionDelegate = myDelegateImplementation
    BDLocationManager.instance().locationDelegate = myDelegateImplementation
    
    // Objective C
    BDLocationManager.instance.sessionDelegate = myDelegateImplementation;
    BDLocationManager.instance.locationDelegate = myDelegateImplementation;
    
  • To avoid unexpected behavior, authentication with the Point SDK must be initiated when the application is in the foreground:

    // UIApplication.State must be active (i.e. foreground) when authenticating with Point SDK
    - (void)authenticateWithApiKey: requestAuthorization:
    
  • To avoid unexpected behavior in the app, implementations of the following two selectors must be present in the Application Delegate:

    // Swift
    func applicationDidEnterBackground(_ application: UIApplication)
    func applicationWillEnterForeground(_ application: UIApplication)
    func applicationWillResignActive(_ application: UIApplication)
    
    // Objective C
    - (void)applicationDidEnterBackground:
    - (void)applicationWillEnterForeground:
    - (void)applicationWillResignActive:
    

    This requirement is already satisfied by the empty implementations that Xcode includes as part of the initial UIApplicationDelegate template. If these are removed or missing for any reason, then an unrecognized selector sent to instance error will occur at runtime.


Please refer to the documentation at http://docs.bluedotinnovation.com