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

Android action handlers in JS not triggered #590

Open
sanmed opened this issue Feb 8, 2016 · 6 comments
Open

Android action handlers in JS not triggered #590

sanmed opened this issue Feb 8, 2016 · 6 comments

Comments

@sanmed
Copy link

sanmed commented Feb 8, 2016

I am using 1.6 and have set the foreground to false in the payload. When the app is terminated and a push notification comes through, clicking on the buttons doesn't trigger the JS handlers. Here's what I see in the logcat log

02-08 13:17:49.117  5091  5091 D PushPlugin_BackgroundActionButtonHandler: BackgroundActionButtonHandler = Bundle[mParcelledData.dataSize=912]
02-08 13:17:49.117  5091  5091 D PushPlugin_BackgroundActionButtonHandler: not id = 0
02-08 13:17:49.119  5091  5091 V PushPlugin: sendExtras: caching extras to send at a later time.
02-08 13:17:49.124   204   809 D audio_hw_primary: select_devices: out_snd_device(2: speaker) in_snd_device(0: none)

I do log the entry point for the triggers in JS and don't see them in the logcat logs.

Is foreground set to false expected to work in the coldstart/in memory scenarios?

@macdonst
Copy link
Member

macdonst commented Feb 8, 2016

@sanmed Yeah, if you kill your app the callback won't be invoked. Related to #158

@sanmed
Copy link
Author

sanmed commented Feb 8, 2016

For what use cases do the foreground of false work? I tested it when the app is suspended and still don't see the callbacks getting invoked.

Any idea when the issue maybe resolved (for firing callbacks when the app is in a terminated state or the background state)

@macdonst
Copy link
Member

macdonst commented Feb 8, 2016

@sanmed when the app is in the background and you set foreground to false on your action button the callback does get called. At least I see my callback get invoked when I attach a debugger to the app.

As for how to fire a callback when the app is terminated, no set timetable. Ideally you should not terminate the app but I understand that users do kill apps. So pull requests are welcome 😄

@sanmed
Copy link
Author

sanmed commented Mar 7, 2016

Thanks Simon. Do you have any updates on this? We'd really like the interactive push notifications to work when the app is in the terminated state :) Any help on this is appreciated. Also, can you provide your contact info as I'd like to run by you a few questions I have? Thanks

@macdonst
Copy link
Member

macdonst commented Mar 7, 2016

@sanmed nope, no updates on this. I haven't had time to work on that particular issue. Not sure if there is much we can do if somone force closes your app.

Re: contact info. I'm @macdonst on twitter, github and the Cordova slack channel so start there.

@macdonst macdonst added this to the Release 1.7.0 milestone Apr 11, 2016
@ejazdragonflycreation
Copy link

passing data with action button, because when app is closed and notification is going to come and when we click on action button the callback is call but how to catch data with this click

@macdonst macdonst modified the milestones: Release 1.8.0, Release 1.7.0 Jun 6, 2016
@macdonst macdonst modified the milestone: Release 1.8.0 Sep 9, 2016
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