Trigger.io
How to integrate Pushwoosh SDK into your Trigger.io project
- 1.Add Pushwoosh module to your app according to the Configuration for your Modules article on Trigger.io.
- 2.
- 3.Locate the
google-services.json
file to thesrc
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();
- 1.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.
- 2.To start location tracking, call:
forge.pushwoosh_geozones.startLocationTracking();
That’s it!
Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.
Last modified 1yr ago