通过点击通知中心的消息启动检测应用程序

通过点击通知中心的消息启动检测应用程序

本文介绍了ios:通过点击通知中心的消息启动检测应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过点击通知中心的消息来了解应用是否已启动?

Is there a way to know if the app was started by tapping message in notification center?

我想只在应用启动时拨打一些电话给服务器通过点击通知中心的消息。

I want to make some calls to server only if the app is started by tapping on a message in notification center.

推荐答案

- (BOOL)应用程序中:( UIApplication * )应用程序didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 应用程序委托的方法,您将在 launchOptions 字典中收到通知信息。这样你就可以知道应用程序是从通知托盘启动的。

In - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method of the application delegate, you will receive the notification information in the launchOptions dictionary. That way you could get to know that the app was launched from the notification tray.

这篇关于ios:通过点击通知中心的消息启动检测应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 12:28