[![CI Status](http://img.shields.io/travis/Akira Matsuda/M2DPushNotificationManager.svg?style=flat)](https://travis-ci.org/Akira Matsuda/M2DPushNotificationManager)
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.
M2DPushNotificationManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "M2DPushNotificationManager"
Akira Matsuda, akira.m.itachi@gmail.com
M2DPushNotificationManager is available under the MIT license. See the LICENSE file for more info.