Push and local notifications are a key factor that make the experience better for consumers - they never have to stay in your app or keep the window open as they will get a proactive notification as soon as a reply or notice is available.
Note: In order to enable push notifications, you must also configure them within the LiveEngage UI. See instructions.
- This method passes the user info of a remote push notification to the SDK:
public func handlePush(userInfo: [NSObject : AnyObject])
- Register device token on LPMesssagingSDK instance:
public func registerPushNotifications(token token: NSData, notificationDelegate: LPMessagingSDKNotificationDelegate? = nil, alternateBundleID: String? = nil)
Note: this method passes the Device Token to the SDK, the actual registration occurs only after showConversation method is called.
- Will add custom behavior if LivePerson Push Notification was touched
<LPMessagingSDKNotificationDelegate> optional func LPMessagingSDKNotification(didReceivePushNotification notification: LPNotification)
- Will hide/show the In-App Push Notification
<LPMessagingSDKNotificationDelegate> optional func LPMessagingSDKNotification(shouldShowPushNotification notification: LPNotification) -> Bool
- Override LPMessagingSDK - In-App Push Notification
<LPMessagingSDKNotificationDelegate> optional func LPMessagingSDKNotification(customLocalPushNotificationView notification: LPNotification) -> UIView
- Add Custom Tap Behavior to LPMessagingSDK - In-App Notification
<LPMessagingSDKNotificationDelegate> optional func LPMessagingSDKNotification(notificationTapped notification: LPNotification)
Note: This method is override when using a Custom View for the In-App Notification (LPMessagingSDKNotification(customLocalPushNotificationView)
Configuring Push Notifications
Follow the instructions below to set up your certificate and key file to enable push notifications.
Note: Before you begin the setup, you must ensure your LiveEngage account is configured and connected to the SDK.
Enter your LiveEngage account through this Login URL.
You will need the following info from your LivePerson account team:
LiveEngage account number
User ID (must be an administrator user)
Within LiveEngage, navigate to Campaigns, and click Data Sources.
- Then select Manage under Mobile App management.
- Click Add new to associate your app with the LiveEngage account.
- Select your platform as iOS, enter your app’s name, and then click Create app. Then, upload your app certificate and key file in the appropriate locations. For more information on your app certificate, please click here.
Note: there is a 50 character limit for your Bundle ID
- Click Close to complete the process.