Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Getting message on background, but 'notification' is not called #374

Closed
yossale opened this issue Nov 24, 2015 · 4 comments
Closed

Getting message on background, but 'notification' is not called #374

yossale opened this issue Nov 24, 2015 · 4 comments

Comments

@yossale
Copy link

yossale commented Nov 24, 2015

(phonegap-plugin-push 1.4.3, cordova android 5.0.0)

I'm sending a background notification, and following the logs, it arrives (see below), but the 'notification' function is not being called in the background. Why?

push.on 'notification', (data) ->
      log("PUSH_DEBUG: notification data: #{JSON.stringify(data)}")

The message contains only an 'info' key

D/PushPlugin_GCMIntentService( 6602): normalize extras
D/PushPlugin_GCMIntentService( 6602): key = info
D/PushPlugin_GCMIntentService( 6602): replace key info with info
D/PushPlugin_GCMIntentService( 6602): key = collapse_key
D/PushPlugin_GCMIntentService( 6602): replace key collapse_key with collapse_key
D/PushPlugin_GCMIntentService( 6602): background
D/PushPlugin_GCMIntentService( 6602): message =[null]
D/PushPlugin_GCMIntentService( 6602): title =[null]
D/PushPlugin_GCMIntentService( 6602): send notification event
V/PushPlugin( 6602): sendExtras: caching extras to send at a later time.
@yossale
Copy link
Author

yossale commented Nov 25, 2015

The 'notification' is being called when the app is running in the background, but if the app is completely closed, it doesnt

@flinux
Copy link

flinux commented Nov 25, 2015

Same problem here with windows universal, 'notification' isn't called if the app is completely closed.

@macdonst macdonst added duplicate and removed retest labels Nov 25, 2015
@macdonst
Copy link
Member

@yossale this is a duplicate of #158. Please go vote it up.

The root cause is when you kill the app you also kill the service that is registered to receive the push. I need to look at a way to automatically restart that service if the app is killed.

@lock
Copy link

lock bot commented Jun 5, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants