极光推送和个推推送对比
1.apns 通知(走的是苹果的apns服务器)
点击推送
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{}
收到推送
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler
2.极光自定义消息 类比 个推消息透传,(无横幅,走的是长连接轮训http,即使手机把此APP的通知关闭也能收到)
应用场景,app某人本来没权限,后台管理系统给他设置权限后,后台发送消息透传,通知APP做刷新,重新请求权限接口
极光自定义消息走此代理(APP激活状态前端运行时走回调,如果app退到后台,不会立即走此回调,但是app由后台到前台时会收到刚才的回调)
- (void)networkDidReceiveMessage:(NSNotification *)notification {
NSDictionary * userInfo = [notification userInfo];
NSString *content = [userInfo valueForKey:@"content"];
NSString *messageID = [userInfo valueForKey:@"_j_msgid"];
NSDictionary *extras = [userInfo valueForKey:@"extras"];
NSString *customizeField1 = [extras valueForKey:@"customizeField1"]; //服务端传递的 Extras 附加字段,key 是自己定义的
NSLog(@"content:%@ messageID:%@ extras:%@ customizeField1:%@",content,messageID,extras,customizeField1);
}
个推消息透传
- (void)GeTuiSdkDidReceivePayloadData:(NSData *)payloadData andTaskId:(NSString *)taskId andMsgId:(NSString *)msgId andOffLine:(BOOL)offLine fromGtAppId:(NSString *)appId{}
极光推送iOS生产环境和开发环境证书配置问题

浙公网安备 33010602011771号