...
- Xcode application with a base SDK of iOS 9 10 and above.
- Xcode application with a deployment target of iOS 7 8 and above.
- An account on the Appoxee dashboard with a configured application.
...
4. Add the following delegate notation (can also be added at AppDelegate.h):
Code Block |
---|
@interface AppDelegate() <AppoxeeDelegate> @endclass 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:
Code Block | ||
---|---|---|
-func application(BOOL)application:( UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[Appoxee shared] engageWithLaunchOptions:launchOptions andDelegate:self andSDKID:@"xxx.xxx"]; // Insert other initialization code or other Frameworks code below. return YES; } | ||
Info | ||
| ||
Attention! you will still need to define AppoxeeConfiguration.plist file, if you need to configure your applications environment, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
Appoxee.shared()?.engageWithLaunchOptions(launchOptions, andDelegate: nil, andSDKID: "123456789.00")
return true
} |
6. Add the following implementation to the method named: application:didRegisterForRemoteNotificationsWithDeviceToken:
Code Block |
---|
- func application(void)application:( UIApplication, *)applicationdidRegisterForRemoteNotificationsWithDeviceToken didRegisterForRemoteNotificationsWithDeviceTokendeviceToken:( NSData *)deviceToken { [[ Appoxee shared] didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } .shared()?.didRegisterForRemoteNotificationsWithDeviceToken(deviceToken) } |
7. Add the following implementation to the method named: application:didReceiveRemoteNotification:
Code Block |
---|
-func application(void)application:( UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [[Appoxee shared] receivedRemoteNotification:userInfo];, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { Appoxee.shared()?.receivedRemoteNotification(userInfo) } |
8. Add the following implementation to the method named: application:didRegisterUserNotificationSettings:
Code Block |
---|
-func application(void)application:( UIApplication, *)applicationdidRegisterUserNotificationSettings didRegisterUserNotificationSettingsnotificationSettings:( UIUserNotificationSettings *)notificationSettings { [[Appoxee shared] didRegisterUserNotificationSettings:notificationSettings]; 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(void)application:( UIApplication, *)applicationhandleActionWithIdentifier handleActionWithIdentifieridentifier:(NSString *)identifier String?, forRemoteNotification:(NSDictionary *)userInfo userInfo: [NSObject : AnyObject], completionHandler:(void (^)())completionHandler) -> Void) { // Must be implemented in order to enable 'Push Actions'. BOOLlet didHandlehandled = [[Appoxee shared] handleActionWithIdentifier:identifier.shared()?.handleActionWithIdentifier(identifier, forRemoteNotification: userInfo, completionHandler:completionHandler]; completionHandler) if (!didHandle) 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
Please review the documentation provided with the SDK for the below methods :
Code Block |
---|
- handleActionWithIdentifierapplication:handleActionWithIdentifier:forRemoteNotification:responseInfo:completionHandler: - didReceiveRemoteNotificationapplication:didReceiveRemoteNotification:fetchCompletionHandler:andNotifyCompletionWithBlock: |
11. OPTIONAL STEP - Appoxee delegate:
Code Block |
---|
#pragma mark - AppoxeeDelegate -func appoxee(void)Appoxeeappoxee:( Appoxee, *)appoxeehandledRemoteNotification handledRemoteNotificationpushNotification:( APXPushNotification, *)pushNotificationandIdentifer andIdentiferactionIdentifier:(NSString *String)actionIdentifier { // a push notification was recieved. } |