This adapter sends push notifications to mobile clients and web browsers using Google FCM. As of the time of this writing it supports Android with Play Services, iOS devices, and all major web browsers excluding Safari.
This adapter requires you to obtain your own credentials from Goole Firebase. If you want to use iOS and Android mobile apps with your service, they must be recompiled with your credentials obtained from Google. If you do not want to recompile mobile clients, consider using TNPG adapter instead.
- Create a project at https://firebase.google.com/ if you have not done so already.
- Follow instructions at https://cloud.google.com/iam/docs/creating-managing-service-account-keys to download the credentials file.
- Update the server config
tinode.conf
, section"push"
->"name": "fcm"
. Do ONE of the following:
- Either enter the path to the downloaded credentials file into
"credentials_file"
. - OR copy the file contents to
"credentials"
.
Remove the other entry. I.e. if you have updated"credentials_file"
, remove"credentials"
and vice versa.
- Update TinodeWeb config
firebase-init.js
: updateapiKey
,messagingSenderId
,projectId
,appId
,messagingVapidKey
. See more info at https://github.com/tinode/webapp/#push_notifications
- If you are using an Android client, add
google-services.json
to Tindroid by following instructions at https://developers.google.com/android/guides/google-services-plugin and recompile the client. You may also optionally submit it to Google Play Store. See more info at https://github.com/tinode/tindroid/#push_notifications - If you are using an iOS client, add
GoogleService-Info.plist
to Tinodios by following instructions at https://firebase.google.com/docs/cloud-messaging/ios/client) and recompile the client. You may optionally submit the app to Apple AppStore. See more info at https://github.com/tinode/ios/#push_notifications