PushNotification在iOS和应用程序图标被点击 [英] PushNotification in iOs and Application icon is clicked

查看:442
本文介绍了PushNotification在iOS和应用程序图标被点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到PushNotification的徽章以及警报,并显示为应用程序图标徽章。

I receive PushNotification as badge as well as alert and are displayed as badges on the app icon.

我收到有效载荷成功当我点击警报,该警报出现在屏幕的顶部区域。

I receive the payload successfully when I click on alert, which appears at top area of the screen.

但是,如果收到通知,我点击应用程序图标我没有得到有效载荷中的任何下面提到的方法。

But, if the notification is received and I click on the application icon i don't get the payload in any of below mentioned the methods.

application:didFinishLaunchingWithOptions:
application:didReceiveRemoteNotification:

所以,可能是什么问题或有我错过了在处理这种情况下的东西。

So, what could be the problem or have I missed something in handling such case.

推荐答案

这将是预期的行为。你不想显示推送通知的用户,如果他自己没有积极选择挖掘警觉。如果用户在您的应用程序,而接到通知,你可以询问用户是否希望进行查看或者解聘了。

That would be expected behavior. You don't want to show the push notification for the user if he himself did not actively chose to to tap on the alert. If user is in your app while receiving notification you can ask the user if he wants to view it or dismiss it.

这篇关于PushNotification在iOS和应用程序图标被点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆