M2DPushNotificationManager 0.1.6

M2DPushNotificationManager 0.1.6

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年5月

Akira Matsuda 维护。



  • 作者:
  • 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 文件。