5

I receive my push notification successfully but when I tap on it, it simply takes me to first view when my app loads.

I want the user to go to specific views depending on the push notification because the user will be receiving many different push notifications (1 for each soccer team, hence possiblity of many different views).

So example: I have a view controller called manchesterUnitedView and somebody just scored so the user receives a push notification for that particular view. When they press it, I want it to take them to the manchesterUnitedView.

Does anyone know how to do this?

thanks

4

2 回答 2

1

您可以使用通知的有效负载将您需要的信息传递给应用程序,然后在由于用户点击通知而启动应用程序时检索并使用它。

为此,只需将自定义字典添加到通知的 JSON 有效负载,然后添加您需要传递给应用程序的信息。

有关有效负载格式的详细信息,请参见此处

application:didFinishLaunchingWithOptions:然后,您可以在您的方法实现中启动应用程序时检索您的自定义字典,UIApplicationDelegate并使用它来初始化您的应用程序状态。

有关如何在 UIApplicationDelegate 中检索有效负载的文档,请参阅此处。

于 2012-06-06T10:26:41.317 回答
0

我也对这个感兴趣。

以下应该可以工作:我在我的 iPhone 上收到推送,单击“查看”按钮后,应用程序应该打开,然后我可以阅读完整的消息。

就像在这个网站上(底部):http ://www.myfitapp.de/fitnessstudio-app/push-nachrichten/

于 2012-06-07T10:06:51.387 回答