简体   繁体   中英

Detect when app receive a push remote notification

how can I handle a remote notification without opening the app (when the banner appear on the screen)

I tried a lot of methods and they are called only when I tap on the notification

If your app needs to analyze push notification without, user tapping on it, you need to set content-available=1 in your push notification,you get the push data in 'didReceiveRemoteNotification' function in your AppDelegate. but you need to consider something, even with this method, there is no guarantee that your application get the push notification data, Your application get the push's data only when your application is in foreground or your app is in background but IOS system is not idling your application otherwise your app is not going to get the push notification from IOS.

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