2011-09-02 255 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