Closed TysonAndre closed 7 years ago
This works in the emulator, and the way to set up uniqush for FCM is pretty much identical to GCM.
To set up FCM, Log in to https://console.firebase.google.com
projectid
(called sender id in FCM) should be visible in the project credentials section. So should the apikey
(Called "Server key" in FCM). Google recommends the longer "Server Key" over the legacy server key.# Add the PSP, can call the service anything, e.g. myproject.fcm,
# or group it under another service
curl http://127.0.0.1:9898/addpsp -d service=myproject.fcm -d pushservicetype=fcm -d projectid=<project id>
# Add a test subscriber programatically by calling the rest API
# E.g. https://github.com/firebase/quickstart-android/tree/master/messaging
# is a test project using FCM which gives you the id in logcat output
curl http://127.0.0.1:9898/subscribe -d service=myproject.fcm -d subscriber=uniqush.client1234 -d pushservicetype=fcm -d regid=blahblah:abcdefgabba_restofregid
# The below command sends a push over FCM
# (See the documentation for GCM, the params are almost the same.
# The documentation can be found at http://uniqush.org/documentation/usage.html)
# The query param uniqush.payload.fcm can also be used instead to provide raw
# JSON payloads for the FCM module to send.
curl http://127.0.0.1:9898/push -d service=myproject.fcm -d subscriber=uniqush.client1234 -d msg=hello
Based on PR #139
This uses anonymous field (in a manner similar to subclassing, but very different) to factor out code common to GCM and FCM http://dennissuratna.com/using-anonymous-field-to-extend-in-go/