Wizcorp / phonegap-plugin-localNotifications

PhoneGap plugin for providing native local notification system to JavaScript.
MIT License
38 stars 29 forks source link

notificationReceived and flag launchedWithNotification not working #4

Closed aerlijman closed 11 years ago

aerlijman commented 11 years ago

In the notificationReceived event there are 3 possible options: launchWithNotification, launch when the app is active and the other. The thing is that only the second and the third are working. I never get the first one to work, so I can not make a difference between when I click it in the notification center or when I get it. Ideas?

aogilvie commented 11 years ago

Sorry, just to be clear.. Do you mean difference between tap in the notification center (top of the screen) or tapping on the application icon? If yes, I do not believe it is possible with our plugin to do this.

aerlijman commented 11 years ago

So.. how do you reach that part of the code you have that I can not reach as explained in my first post? I think I am missing something because the variable flag you have called launchedWithNotification is always NO. Ideas?

wcwynn commented 11 years ago

The description of this issue is a bit vague but I suspect the 3 possible cases you are referring to is the code located here: https://github.com/Wizcorp/phonegap-plugin-localNotifications/blob/v2.3/ios/project/Plugins/LocalNotification/LocalNotification.m#L198

Here is how you can trigger these 3 cases using the test app:

Launch the test app.

  1. Add Notification and wait for the notification to fire.
  2. Add Notification, put the app in the background. When the notification fires, click the notification.
  3. Add Notification, put the app in the background, double-click the home button and then kill the app (by long-pressing the app icon at the bottom of the screen and then clicking the red 'minus' symbol). When the notification fires, click the notification.

Note that for case 3 you won't be able to verify it in the debugger as you're required to kill the app, but that doesn't mean the code is not working.

All 3 cases are tested and working. If you find otherwise, please re-open this issue.