我正在尝试很多但尚未成功在应用程序被杀死状态时获得无声通知
这是我正在尝试的代码..
APS数据:
Failed to resolve: android.arch.lifecycle:extensions:1.0.0-alpha1
答案 0 :(得分:2)
在有效负载的aps
词典中,不得包含提醒,声音或徽章键。
{
"aps":{
"content-available" : 1
}
}
请试一试。
答案 1 :(得分:0)
您应该在AppDelegate.m
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
NSDictionary *aps = [userInfo objectForKey:@"aps"];
NSLog(@"hello");
NSLog(@"userinfo---->>>>%@",userInfo);
[UIApplication sharedApplication].applicationIconBadgeNumber=[[aps objectForKey:@"badge"] integerValue];
[self application:application didReceiveRemoteNotification:userInfo];
}