Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
class AppDelegate: UIResponder, UIApplicationDelegate, AppoxeeNotificationDelegate {

	/* Class code goes here */
}

 

5. Add the following implementation to the method named: application:didFinishLaunchingWithOptions:, Where, xxx.xxx represents the SDK ID. These were created for you with the Appoxee Dashboard:

Attention! you will still need to define AppoxeeConfig.plist file, if you need to configure your applications environment
Code Block
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    
    Appoxee.shared()?.engageWithLaunchOptions(launchOptions, andDelegate: nil, andSDKID: "123456789.00")
    
    return true
}
Info
titleAppoxeeConfiguration.plist

 

6. Add the following implementation to the method named: application:didRegisterForRemoteNotificationsWithDeviceToken:

Code Block
 func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {        
	Appoxee.shared()?.didRegisterForRemoteNotificationsWithDeviceToken(deviceToken)
}

 

7. Add the following implementation to the method named: application:didReceiveRemoteNotification:

Code Block
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
    
    Appoxee.shared()?.receivedRemoteNotification(userInfo)
}

 

8. Add the following implementation to the method named: application:didRegisterUserNotificationSettings:

Code Block
func application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) {
    
    Appoxee.shared()?.didRegisterUserNotificationSettings(notificationSettings)
}

 

9. OPTIONAL STEP -  To implement iOS8 'Push Actions', add the following implementation to the method named: application:handleActionWithIdentifier:forRemoteNotification:completionHandler:

Code Block
func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forRemoteNotification userInfo: [NSObject : AnyObject], completionHandler: () -> Void) {
    
    // Must be implemented in order to enable 'Push Actions'.
    let handled = Appoxee.shared()?.handleActionWithIdentifier(identifier, forRemoteNotification: userInfo, completionHandler: completionHandler)
    
    if handled == false {
        
        completionHandler(); // Handle the action in case it is not handled by Appoxee. When done - completionHandler() must be called.
    }
}

 

10. OPTIONAL STEP – Silent push

...

Code Block
application:handleActionWithIdentifier:forRemoteNotification:responseInfo:completionHandler:
application:didReceiveRemoteNotification:fetchCompletionHandler:

 

11. OPTIONAL STEP - Appoxee delegate:

...