I'm using the cordova plugin. Is there a way to take an action when the notification is actually received instead of having to wait for the user to click on it?

asked 14 Apr '15, 14:46
shenck's gravatar image



Short answer is "not for Cordova".

The long answer is:
For iOS there is no way to perform the action before user clicked on a push notification. It is iOS requirement. Only when user clicks on push notification operating system runs the app and executes its code.

On Android it is possible on a Native app as push receiving code runs in a Service. However as the Service runs Native Java code and there is no Cordova JS wrapper available it is possible only on a Native app.

permanent link
answered 15 Apr '15, 07:16
shader's gravatar image



Am I correct that your question is related to the iOS platform?

It is possible by calling the onPushReceived:withNotification:onStart: method instead of the onPushAccepted:withNotification:onStart:

Please refer to the following links for more information about these methods:



permanent link
answered 14 Apr '15, 15:05
Andrew_H's gravatar image


This is not a native app. This is related to the cordova (phonegap) plugin. The API only includes the methods listed in this link.


The event for the push notification is only fired once the user clicks on the Notification. This is the same in iOS and Android. I need a way to fire off some work beforehand though and that is what my question is referring to.


(14 Apr '15, 17:58) shenck shenck'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: 14 Apr '15, 14:46

question was seen: 2,145 times

last updated: 15 Apr '15, 07:16