2013-08-06 67 views

回答

0

当您的应用程序收到通知时,application:didReceiveRemoteNotification:在您的应用程序代理中执行,而不是 OS级别的通知。不管你喜欢什么样的逻辑,你都可以在这里显示通知。我不相信你可以创建并显示操作系统级别的横幅,但你可以创建一个UIVIew的动画来模仿它的外观

0

你可以随时使用默认方法来使用Push when App已打开:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 
{ 
    NSLog(@"\n\n\nPush ==== %@\n\n\n",userInfo); 

    NSString *apnsMessage=[[userInfo objectForKey:@"aps"] objectForKey:@"alert"]; 

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Push Message" message:apnsMessage delegate:delegate cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; 

    [alert show]; 

    [alert release]; 
} 
相关问题