To launch and utilize a sample with Pushwoosh SDK integration, clone or download the repository archive.
cordova plugin add pushwoosh-cordova-plugin
2. Navigate to the js folder within the www directory and open the file named index.js. Add your App ID and FCM Sender ID
/**
* Function: onDeviceReady
* [android, ios, wp8, windows] Initialize Pushwoosh plugin and trigger a start push message
* Should be called on every app launch
* Parameters:
* "config.appid" - Pushwoosh application code
* "config.projectid" - GCM project number for android platform
* "config.serviceName" - MPNS service name for wp8 platform
*/
function initPushwoosh() {
var pushwoosh = cordova.require("pushwoosh-cordova-plugin.PushNotification");
//Should be called before pushwoosh.onDeviceReady
document.addEventListener('push-notification', function(event) {
var notification = event.notification;
// handle push open here
});
pushwoosh.onDeviceReady({
appid: "XXXXX-XXXXX",
projectid: "XXXXXXXXXXXXXXX",
serviceName: "XXXX"
});
}
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
...
</platform>
a. Open the Xcode project, navigate to the TARGETS tab, and add your App Group name in the App Group section for both targets (newdemo and NotificationService).
<key>PW_APP_GROUPS_NAME</key>
<string>group.com.example.demo</string>
The guide for SDK integration is available on the Pushwoosh website
Documentation: https://github.com/Pushwoosh/pushwoosh-ios-sdk/tree/master/Documentation
Pushwoosh team http://www.pushwoosh.com