M2DPushNotificationManager 0.1.6

M2DPushNotificationManager 0.1.6

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2016

Maintained by Akira Matsuda.



  • By
  • Akira Matsuda

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

First, request device token to APNS.

[[M2DPushNotificationManager sharedInstanceWithDelegate:self] registerDeviceTokenWithRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound) sendToProviderBlocks:^(NSString *token) {
    //send device token to your server.
}];

Second, decode device token

- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    [[M2DPushNotificationManager sharedInstance] processDeviceToken:deviceToken];
}
//If you are using iOS8, please implenent this method.
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
    [application registerForRemoteNotifications];
}

All done.

Requirements

Installation

Author

Akira Matsuda, [email protected]

License

M2DPushNotificationManager is available under the MIT license. See the LICENSE file for more info.