Telerik-Verified-Plugins / PushNotification

Push Notification Plugin for iOS and Android
MIT License
55 stars 57 forks source link

iOS: alerts when sleeping #21

Open fyrstelin opened 9 years ago

fyrstelin commented 9 years ago

When app sleeps, no alerts shows.

Example:

  1. Open your app
  2. Press the sleep button (screen goes blank)
  3. Send alert notification from server
  4. Nothing happens <- this is the problem
  5. Wake app
  6. Alert arrives inapp (no native notification)

As far as I understand, this is probably the way the os should handle the notification and let the app react to it. Problem is that the javascript does not run before the app is open again.

fyrstelin commented 9 years ago

Am I the only one with this problem?

AntonDobrev commented 9 years ago

Indeed, this is the expected behavior in iOS - the JS callback will be executed only when the app is launched through the notification or the notification is received when the app is running.

fyrstelin commented 9 years ago

It would be nice if the plugin treated push notifications when the app is sleeping in the same manner as when the app i closed or in background. I do not know any bigger app, where push notifications does not trigger an alert when the app is sleeping. Would you consider implementing it?

markusv commented 9 years ago

The problem also exists if actions with

activationMode: pushPlugin.UserNotificationActivationMode.Background

are clicked by the user. How de we handle this? The notification arrives in js when app is started. This kind of defeats the purpose of this setting pushPlugin.UserNotificationActivationMode.Background. If the app needs to be started for the js being called there is no need for this option. Or am I missing something here?