是否可以处理后台收到的苹果推送通知?

时间:2011-11-02 17:51:54

标签: iphone push-notification apple-push-notifications

可以区分用户手动恢复应用程序或接受推送通知吗?

我也想处理推送通知参数。

1 个答案:

答案 0 :(得分:2)

我认为您正在寻找didReceiveRemoteNotification,这是推送通知到达时调用的方法。

您需要查看UIApplication Delegate Protocol Reference!还有其他一些方法可用于远程通知。

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if ( application.applicationState == UIApplicationStateActive )
    // app was already in the foreground
else
    // app was just brought from background to foreground
...
}