Skip to content

Commit 5dd860a

Browse files
committed
adds update FCM token code snippet in readme
1 parent 3c4e7d4 commit 5dd860a

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,33 @@ webengage.track("Purchased", {"product-id": "123", "product-name": "wrist-watch"
174174

175175
#### FCM Integration
176176

177-
1. Add this plugin to your Cordova project.
177+
**1. Add this plugin to your Cordova project.**
178178

179179
```
180180
cordova plugin add https://github.com/WebEngage/cordova-plugin-android-fcm.git --fetch
181181
```
182182

183-
2. Add google-services.json file.
183+
**2. Add google-services.json file.**
184184

185185
Follow the steps at [Android FCM Documentation](https://firebase.google.com/docs/android/setup) to get the google-services.json file from Firebase Cloud.
186186

187187
Save google-services.json file in the root of your project directory.
188188

189+
**3. Update FCM token on app launch.**
190+
191+
Send FCM token to WebEngage SDK in your `wwww/js/index.js` file.
192+
193+
```javascript
194+
var app = {
195+
...
196+
onDeviceReady: function() {
197+
...
198+
199+
androidfcm.updateToken();
200+
}
201+
}
202+
```
203+
189204
Done. Run and test push notifications from WebEngage dashboard on your Android app.
190205

191206
#### GCM Integration (Deprecated)

0 commit comments

Comments
 (0)