One of our requirements is to display the notifications in the notifications tray even when our hybrid app (using cordova) receives it being in the foreground. Is there any way to do this?

asked 03 Jun '15, 08:54
Alejandro's gravatar image

Alejandro
113

Done.

For Cordova plugin it's supported in the latest published release.

Use the following metadata key in AndroidManifest.xml
(http://developer.android.com/guide/topics/manifest/meta-data-element.html):

<meta-data android:name="PW_NO_BROADCAST_PUSH" android:value="true" />

permanent link
answered 08 Jul '15, 16:09
shader's gravatar image

shader
3.9k7

You can remove next code line in your PushNotification.m in order to enable these notifications:

pushManager.showPushnotificationAlert = FALSE;

permanent link
answered 04 Jun '15, 11:16
arthur's gravatar image

arthur
1007

edited 05 Jun '15, 12:22

At the moment you have to modify the code. For Android it is (PushNotifications.java):

    //comment this code out if you would like to receive the notifications in the notifications center when the app is in foreground
    cordova.getActivity().registerReceiver(mReceiver, intentFilter);

It will be a part of the settings in the next updates.

permanent link
answered 08 Jun '15, 16:59
shader's gravatar image

shader
3.9k7

Is there any way to do it without modifying the source code? I don't want to have my own version just for a line of code. I will submit an issue in the github repo anyway. Thanks.

permanent link
answered 05 Jun '15, 02:09
Alejandro's gravatar image

Alejandro
113

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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:

×444
×190
×47

question asked: 03 Jun '15, 08:54

question was seen: 2,019 times

last updated: 08 Jul '15, 16:09