Open danlg opened 8 years ago
https://github.com/katzer/cordova-plugin-local-notifications/issues/625
notifications for ios in foreground is not supported. It is by design. https://www.google.com.hk/search?q=notifications+for+ios+in+foreground&oq=notifications+for+ios+in+foreground&aqs=chrome..69i57.304j0j7&sourceid=chrome&es_sm=91&ie=UTF-8
As it happens, this is how iOS handles push notifications: if the app is in the foreground, iOS will not display the push notification alert or banner.
You can easily simulate push notification alerts with a UIAlertView, which is what handlePush: does when called from application:didReceiveRemoteNotification:. To display a banner, instead, you'll need to write your own custom view that is animated from the top of the app, and trigger the animation to start when a notification is received in application:didReceiveRemoteNotification:.
Make sure to check that [UIApplication sharedApplication].applicationState == UIApplicationStateActive is true, which indicates that the app was in the foreground already.
When receiving a push notification, create a Deep link so that the recipient goes to message thread in app.
See also #83