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

Android: notification does not dismiss after selection button (1.6.x dev) #610

Closed
jopelkey opened this issue Feb 12, 2016 · 6 comments
Closed

Comments

@jopelkey
Copy link

I am trying to get a head-start on using the 1.6.x version of the plugin, so I realize it may be 'buyer beware' at this point...

On Android, I get a push notification and it has my action buttons. When I select an action button, the callback gets called and everything appears to run ok. But the notification does not get dismissed. It should get dismissed automatically shouldn't it? I didn't think there was anything I needed to do on my end to make that happen was there? This is running with the action button set as foreground: false.

Here's the adb logcat output for the plugin at the time I hit the action button.

D/PushPlugin_BackgroundActionButtonHandler(28049): BackgroundActionButtonHandler = Bundle[mParcelledData.dataSize=1408]
D/PushPlugin_BackgroundActionButtonHandler(28049): not id = 0
D/PushPlugin(28049): convert extras to json
D/PushPlugin(28049): key = actions
D/PushPlugin(28049): key = pushPayload
D/PushPlugin(28049): key = callback
D/PushPlugin(28049): key = icon
D/PushPlugin(28049): key = notId
D/PushPlugin(28049): key = title
D/PushPlugin(28049): key = message
D/PushPlugin(28049): key = coldstart
D/PushPlugin(28049): key = collapse_key
D/PushPlugin(28049): key = foreground
V/PushPlugin(28049): extrasToJSON: {"title":"Mobile Auth","message":"Some tenant name\nLogin Verification\nsome.tenant.com","additionalData":{"actions":[{"callback":"window.rejectVerification","foreground":false,"title":"Reject"},{"callback":"window.acceptVerification","foreground":false,"title":"Accept"}],"pushPayload":{"request":{"loginUri":"sendMsg.fake.com","tenantName":"sendMsg.js fake tenant","responseUri":"responseUri","requestTimestamp":1455305073,"requestId":4058401,"tenantId":"tenantId","userId":"userId","uri":"uri"},"authenticatorId":"authId"},"callback":"window.acceptVerification","icon":"ic_launcher","notId":"1455305073","coldstart":false,"collapse_key":"do_not_collapse","foreground":false}}

@macdonst
Copy link
Member

@jopelkey are you sure you are using the most up to date v1.6.x? What you talk about should be fixed with this commit:

ed8360c

@jopelkey
Copy link
Author

Hmm - pretty sure I have the latest as of a few hours ago. My package.json has this entry in it in:
{
"locator": "https://github.com/phonegap/phonegap-plugin-push#v1.6.x",
"id": "phonegap-plugin-push",
"variables": {
"SENDER_ID": "..." // with my real id here...
}
},

and I am downloading that using 'ionic state restore'

I also checked the code in my plugins/phonegap-plugin-push directory and it looks like it has all the changes from the commit you mention.

The other reason I think I'm up to date is that I was able to verify on the code I have that the bug you fixed the other day (#584) where not specifying an icon in the actions was throwing a JSON exception.

@jopelkey
Copy link
Author

I think I figured something out here.

If my payload has a 'notId' in it, the notification does not get dismissed.
If I take the 'notId' out of the payload, the notification does get dismissed.

'notId' shouldn't affect the dismissal behavior should it?

@macdonst macdonst added this to the Release 1.6.0 milestone Feb 12, 2016
@macdonst
Copy link
Member

@jopelkey nope, that should work. Thanks for looking into it. I really appreciate your bugs as they are actually things I can fix. 😸

@macdonst
Copy link
Member

@jopelkey again, thanks for the excellent bug reports. I'm back from two weeks of travel so I've just pushed the fix to the 1.6 branch.

macdonst added a commit that referenced this issue Feb 29, 2016
macdonst added a commit that referenced this issue Mar 1, 2016
macdonst added a commit that referenced this issue Mar 9, 2016
@macdonst macdonst removed the staging label Mar 9, 2016
@macdonst macdonst closed this as completed Mar 9, 2016
@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

2 participants