Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 13 days 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 (about 11 years ago)
- Default Branch: master
- Last Pushed: 2023-04-16T07:15:49.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T19:22:18.781Z (13 days ago)
- Topics: ios, ios-app, objective-c, objective-c-library
- Language: Objective-C
- Homepage:
- Size: 94.7 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# M2DPushNotificationManager
[![CI Status](http://img.shields.io/travis/Akira Matsuda/M2DPushNotificationManager.svg?style=flat)](https://travis-ci.org/Akira Matsuda/M2DPushNotificationManager)
[![Version](https://img.shields.io/cocoapods/v/M2DPushNotificationManager.svg?style=flat)](http://cocoadocs.org/docsets/M2DPushNotificationManager)
[![License](https://img.shields.io/cocoapods/l/M2DPushNotificationManager.svg?style=flat)](http://cocoadocs.org/docsets/M2DPushNotificationManager)
[![Platform](https://img.shields.io/cocoapods/p/M2DPushNotificationManager.svg?style=flat)](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, [email protected]
## License
M2DPushNotificationManager is available under the MIT license. See the LICENSE file for more info.