https://github.com/0x0c/m2dpushnotificationmanager
Get device token and send to your server.
https://github.com/0x0c/m2dpushnotificationmanager
ios ios-app objective-c objective-c-library
Last synced: 8 months ago
JSON representation
Get device token and send to your server.
- Host: GitHub
- URL: https://github.com/0x0c/m2dpushnotificationmanager
- Owner: 0x0c
- License: mit
- Created: 2014-01-22T11:09:03.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-04-16T07:15:49.000Z (about 3 years ago)
- Last Synced: 2025-10-15T23:30:07.807Z (8 months ago)
- Topics: ios, ios-app, objective-c, objective-c-library
- Language: Objective-C
- Homepage:
- Size: 94.7 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# M2DPushNotificationManager
[](https://travis-ci.org/Akira Matsuda/M2DPushNotificationManager)
[](http://cocoadocs.org/docsets/M2DPushNotificationManager)
[](http://cocoadocs.org/docsets/M2DPushNotificationManager)
[](http://cocoadocs.org/docsets/M2DPushNotificationManager)
## 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](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
pod "M2DPushNotificationManager"
## Author
Akira Matsuda, akira.m.itachi@gmail.com
## License
M2DPushNotificationManager is available under the MIT license. See the LICENSE file for more info.