简体   繁体   中英

Handle push notification when app is running and notification tray is opened

While trying to implement FCM in my iOS app, I came across this issue. I have my app opened , at the same time I slide down the Notification tray of my device. When I send a push notification, my application state prints as INACTIVE (which is correct since the tray comes in foreground, leaving my app in the background)

I am loading a URL on notification tap, hence when user slides up the tray, the url is directly loaded and no notification is displayed in the tray.

In this scenario, I wish to display notification in the tray and open URL only when the user taps on the notification. Is there any way to detect if the Notification tray is visible over my app specifically ?

您可以使用第三方库: https : //github.com/bryx-inc/BRYXBanner ,也可以通过处理应用程序在接收通知的委托中处于前台还是非活动状态来显示警报。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM