2011-09-02 175 views
4

链接服务器我用http://stefan.hafeneger.name/download/PushMeBabySource.zip推送通知

我用PushMeBaby服务器和我的证书和供给曲线推应用程序,它在设备警报的形式给予通知并打印书面的方法,只有当在控制台上的发言我第一次运行应用程序,但在运行应用程序下次多次测试时,它只返回设备标记,下面的方法根本不执行。请帮我解决这个问题。

- (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]; 
    }*/ 

    } 
} 

请尽快

回答

3

帮我你需要让你每次启动应用程序时的标记。有时它会改变。

+0

的设备令牌?这是否改变? –

+0

Yupp。您应该在应用程序的每次启动时使用TellToken。苹果公司不会告诉我们设备令牌在什么情况下发生变化。所以我们在每次启动时都得到一个 – nurxyz

+1

好的谢谢! –

2
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