测试已测试 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | MIT |
发布最后发布 | 2016年5月 |
由 Akira Matsuda 维护。
要运行示例项目,首先克隆仓库,然后从 Example 目录首先运行 pod install
。
首先,向 APNS 请求设备令牌。
[[M2DPushNotificationManager sharedInstanceWithDelegate:self] registerDeviceTokenWithRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound) sendToProviderBlocks:^(NSString *token) {
//send device token to your server.
}];
其次,解码设备令牌
- (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];
}
完成。
Akira Matsuda,[email protected]
M2DPushNotificationManager 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。