Skip to content

0x0c/M2DPushNotificationManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M2DPushNotificationManager

[![CI Status](http://img.shields.io/travis/Akira Matsuda/M2DPushNotificationManager.svg?style=flat)](https://travis-ci.org/Akira Matsuda/M2DPushNotificationManager) Version License Platform

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

M2DPushNotificationManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "M2DPushNotificationManager"

Author

Akira Matsuda, [email protected]

License

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