Introduction to Mobile Engagement SDK Reference (iOS)
The Mobile Engagement framework is a location and notification based system.
The recommended way to start Mobile Engagement in your application is to place a call to +startWithmaasAppId:accessKey:signatureKey:encryptionKey:completion: in your -application:didFinishLaunchingWithOptions: method.
This delay defaults to 1 second in order to generally give the application time to fully finish launching.
The framework needs you to forward the following methods from your application delegate:
You can optionally add a delegate to be informed about errors while initializing the location marketing service and to control the display of local notifications to the user.
Mobile Engagement SDK Integration Guide (iOS)
Step 1: Installation
The recommended way to use PWEngagement is via CocoaPods.
- Add the following pod to your
Podfile: pod 'PWEngagement'
- Do pod install
- Navigate to Build Phases inside your Xcode Projects and click on Link Binary With Libraries add following frameworks:
Step 2: p12 Push Notification Certificate
Step 3: Application Setup
Add the following key/values to your application's Info.plist file:
Required background modes:
App registers for location updates(This value allows the app to keep users informed of their location, even while it is running in the background.)
App downloads content in response to push notifications(This value allows the app to regularly download remote notifications.)
- Uses Bluetooth low energy accessories (This value allows for the app to range for vBLE .)
MaaSAppId : The application ID matching the server choice.
- MaaSAccessKey : The accesskey for your application.
- MaaSSignatureKey : The signature key for your application.
iOS 11 Location Prompt Changes
- NSLocationWhenInUseUsageDescription: The message to display to user for user to grant the location usage only when in use.
- NSLocationAlwaysAndWhenInUseUsageDescription: The message to display to user for user to grant the location usage when in use and always.
- NSLocationAlwaysUsageDescription: The message you want to display on the prompted alert when the user grants the app permission to use the location service.
iOS 13 Bluetooth Prompt - add Key and description to application's info.plist
Key: NSBluetoothAlwaysUsageDescription. App needs access to bluetooth for hardware measurements and to receive location based messages from bluetooth beacons
Wifi Capability - The Mobile Engagement SDK has a dependency on the Phunware Core SDK. If you would like Core to be able to return information about the Wifi network the device is attached to via the "currentWifi" public method in the Core SDK's CoreDevice class, then add the "networking.wifi-info" key to your application by going to the capabilities section in the app's project file. Turn on the "Access Wifi Information" button. Then make sure the provisioning profile used to sign the application has the same capability.
Step 4: Application Initialization
Objective-C Bridging Header for Swift projects (Option)
Step 5: Beacon and Geofence Registration
Step 6: Remote Notification Handling
Step 7: Fetching/Updating Profile Attributes
Step 8: Listening for and Receiving Notifications
Deep Linking (Option)
Promotions Handling (Option)
PWEngagement API documentation is included in the Documents folder in the repository as both HTML and as a .docset. You can also find the latest documentation here: Introduction to Mobile Engagement SDK Reference (iOS)