Hi, I am trying to setup notifications for phonegap build using android and ios and I had a couple questions concerning the firing of the event listener for the notification. Here is what I am trying to do: when the user receives the notification I would like to save the data from that notification in local storage to be displayed to the user at a later time. This is problematic it seems since if you close the app entirely (i.e. by killing it), while you may still receive the notification the event listener should no longer be running making it impossible to save the data. Am I correct in this assumption? Second, should the event listener still be running (in the case by which the user has simply put the app to the background instead of actually killing it), will the event listener still execute the code even though the app is not in the foreground OR will it wait to execute the code until the app is reopened, OR will it not execute at all? Than you for your time and I am looking forward to hearing back from you.

asked 12 Sep '15, 21:05
tarstarkes's gravatar image


On iOS:
(app is in background)
Regular push:
The notification would be only delivered to the app if user pressed on the notification in the notification center.
Silent (newsstand) push:
Send silent (newsstand) notification, the app will be launched in background to handle the notification. You need to add remote-notification mode in Background Modes in Info.plist file.

(app is in foreground)
The notification would be delivered to the app.

Use custom Push Broadcast Receiver to handle the notification and store it in the database:

permanent link
answered 18 Sep '15, 14:24
shader's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 12 Sep '15, 21:05

question was seen: 1,644 times

last updated: 18 Sep '15, 14:24