Download Module Download Geozones Module Download Sample Module API Docs Geozones Module API Docs
Add Pushwoosh module to your app according to the Configuration for your Modules article on Trigger.io.
Configure your project in Firebase Console.
Locate the google-services.json
file to the src
folder in your project directory.
google-services.json
You should've gotten the google-services.json
file while creating the app in Firebase console. If you haven't, please consult this thread (section Get a config file for your Android app).
4. Set up push notifications handler:
forge.internal.addEventListener("pushwoosh.pushReceived",function (notification) {alert('push received: ' + notification);});
5. Set up push registration handler:
forge.internal.addEventListener("pushwoosh.registrationSuccess",function (status) {log('registered with token: ' + status['deviceToken']);});
6. Call “onDeviceReady” method (make sure you call this method each time the app starts):
Replace ENTER_PUSHWOOSH_APP_ID with your real Pushwoosh App ID, and for Android replace FCM_SENDER_ID with Sender ID you got from the Firebase Console.
forge.pushwoosh.onDeviceReady({"pw_appid":"ENTER_PUSHWOOSH_APP_ID", "gcm_id":"ENTER_FCM_SENDER_ID"});
5. Register for push notifications:
forge.pushwoosh.registerDevice();
To enable location tracking in your app, add pushwoosh_geozones module to your app according to the Configuration for your Modules article on Trigger.io.
To start location tracking, call:
forge.pushwoosh_geozones.startLocationTracking();
That’s it!