如何在目标c中的推送通知按钮事件上加载应用程序?
我想知道是否可以在目标 c 中单击推送通知的“确定”按钮来加载应用程序或某些特定页面。
因为我想在按下推送通知按钮时加载应用程序。如果可能,请帮助我。
谢谢你。
I wanted to know whether it is possible to load the application or some specific page on clicking the "OK" button of the push notification or not in objective c.
As i want to load the application when i press the button of the push notification.Kindly help me out if possible.
Thanking you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
推送通知通常有一个“查看”按钮,可以自动启动您的应用程序。您无需在应用程序中执行任何操作即可使其正常工作。
当用户以这种方式启动应用程序时,您的应用程序委托会收到对
的调用
- (BOOL) 应用程序:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
,launchOptions
字典,包含服务器添加到推送通知有效负载的任何数据。您可以检查并打开任何相关页面或视图,或者以您想要的方式处理该通知。
the push notification usually have a "View" button that will automatically launch your application. you don't have to do anything in your app for that to work.
when the user launches the application that way, your app delegate receives a call to
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
,the
launchOptions
dictionary containing whatever data was added to the push notification payload by the server.you can check that and open any relevant page or view, or handle that notification anyway you want.