iOS push notification received when app is running in foreground

后端 未结 3 1668
旧时难觅i
旧时难觅i 2021-01-19 04:54

From my understanding, when app is running or in the foreground and a push notification is received, the app should NOT show any alert but the app delegate will call the

3条回答
  •  生来不讨喜
    2021-01-19 05:44

    You are most likely seeing the additional push notification because of the way Urban Airship is configured in your code. From Urban Airship's docs:

    The sample UI includes an implementation of UAPushNotificationDelegate that handles alerts, sounds, and badges. However, if you wish to customize this behavior, you can provide your own implementation:

    [UAPush shared].pushNotificationDelegate = customPushDelegate;

    There is more information on the proper way to handle push notifications with Urban Airship in their support articles. Since you are using UA, I would recommend that you use their delegates etc. to handle incoming push notifications while in the foreground rather than implementing your own code in the didReceiveRemoteNotification app delegate method.

    Hopefully that helps...if not, please post your code so that we can decipher what is going on. This would be very odd behavior indeed!

提交回复
热议问题