我使用http://stefan.hafeneger.name/download/PushMeBabySource.zip的服务器链接
我使用PushMeBaby服务器和推送应用程序和我的证书和配置文件,它在设备上以警报的形式给出通知,并在第一次运行应用程序时才在控制台上打印以方法编写的语句,但在下一次多次运行应用程序以测试它只返回设备令牌时,以下方法不能在all.Please上执行,这有助于我解决这个问题。
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
for (id key in userInfo) {
NSLog(@”key: %@, value: %@”, key, [userInfo objectForKey:key]);
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”alert” message:key delegate:self cancelButtonTitle:@”ok” otherButtonTitles:nil];
[alert show];
/*if(key)
{
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@”alert” message:@”this is in application” delegate:self cancelButtonTitle:@”ok” otherButtonTitles:nil];
[alert show];
}*/
}
}请尽快帮助我
发布于 2011-09-02 19:31:35
您需要在每次启动应用程序时获取令牌。有时它会改变。
发布于 2011-09-02 20:21:07
The delegate (didReceiveRemoteNotification) gets invoked when a running application receives a remote notification.
If you implement application:didFinishLaunchingWithOptions: to handle an incoming push notification that causes the launch of the application, this method (didReceiveRemoteNotification) is not invoked for that push notification.有关推送通知的详细信息,请参阅:
developer apple-ApplePushService
https://stackoverflow.com/questions/7282759
复制相似问题