Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding options like dry_run and collapse key to GCM notification #71

Closed
callmeahab opened this issue Apr 7, 2017 · 3 comments
Closed

Comments

@callmeahab
Copy link

Can't find a way to send options parameters from https://developers.google.com/cloud-messaging/http-server-ref#downstream-http-messages-json to gcm. Tried adding to notification and data but they don't work there. Also tried adding them to notification payload directly but am getting key does not exist error.

Am I missing something here?

Thanks

@hpopp
Copy link
Member

hpopp commented Apr 7, 2017

When you add to the payload directly, are you using string keys or atom keys?

@callmeahab
Copy link
Author

It seems to work if i use atom keys. Like so:

payload = Map.put(n.payload, :dry_run, true)
notification = Map.put(n, :payload, payload)

However I'm not sure since for gcm response i always get just :ok atom, and not the response described in the documentation.

Also probably unrelated, but data object, or stuff like icons i send to android doesn't show up if app is not in the foreground. But that could be bug on the android side.

@hpopp
Copy link
Member

hpopp commented Jul 6, 2018

As of v1.2.1 the following keys are now top-level on the FCM struct:

  • time_to_live
  • collapse_key
  • restricted_package_name
  • dry_run

Closing this.

@hpopp hpopp closed this as completed Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants