Appcelerator Titanium
How to integrate Pushwoosh SDK into your Titanium project

Supports iOS, Android

To integrate Pushwoosh into your Appcelerator Titanium application, follow these simple steps:
1. Download the Push Notifications Module and put it in your Modules folder.
2. Enable this module in tiapp.xml as per Appcelerator guide.
3. Configure your project in Firebase Console:
4. Locate the google-services.json file to the app/platform/android 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).
5. Initialize module and register for push notifications:
1
var pushwoosh = require('com.pushwoosh.module');
2
3
pushwoosh.onPushReceived(function(e) {
4
var message = e.message;
5
// shows a push is received. Implement passive reaction to a push, such as UI update or data download.
6
});
7
8
pushwoosh.onPushOpened(function(e) {
9
var message = e.message;
10
// shows a user tapped the notification. Implement user interaction, such as showing push details.
11
});
12
13
pushwoosh.initialize({
14
"application" : "ENTER_PUSHWOOSH_APPID_HERE",
15
"gcm_project" : "ENTER_FCM_SENDER_ID_HERE"
16
});
17
18
pushwoosh.registerForPushNotifications(
19
function(e) {
20
var pushToken = e.registrationId;
21
// handle successful push registration here
22
},
23
function(e) {
24
var errorMessage = e.error;
25
// handle push registration error here
26
}
27
);
Copied!
Last modified 9d ago
Copy link