Marmalade SDK

Integrating Pushwoosh SDK into your Marmalade project

Supports iOS, Android, Windows Phone

Pushwoosh extension requires Marmalade v8.3.0p2 or newer for Android platform

Download SDK
Download Sample
Extension API Docs

To integrate Pushwoosh into your Marmalade application:

  1. Download Marmalade Pushwoosh s3e extension.

  2. Include the extension in your mkb file by adding s3ePushWoosh subproject: subproject ../s3ePushWoosh

  3. Add the following push notifications callbacks in your code:

int32 OnPushRegistered(char* token, void* userData)
{
    // TODO: handle push notifications registration here
    return 0;
}
 
int32 OnPushReceived(char* text, void* userData)
{
    // TODO: handle push notifications here
    // push notifications comes as JSON string payload:
    //     {"aps":{
    //             alert = "Hello from Pushwoosh!";
    //             sound = default;
    //         },
    //         "onStart":1
    //     }
    return 0;
}
 
int32 OnPushRegisterError(char* error, void* userData)
{
    // TODO: handle push registration error here
    return 0;
}
  1. In your main function add:

Windows Phone

Do not forget to put your Pushwoosh App ID instead of ENTER_YOUR_PUSHWOOSH_APP_ID_HERE!

You can ignore this parameter for other platforms.

if (s3ePushWooshNotificationsAvailable())
{
    s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_SUCCEEDED, (s3eCallback)&OnPushRegistered, 0);
    s3ePushWooshRegister(S3E_PUSHWOOSH_MESSAGE_RECEIVED, (s3eCallback)&OnPushReceived, 0);
    s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_ERROR, (s3eCallback)&OnPushRegisterError, 0);
 
    s3ePushWooshNotificationRegister(“ENTER_YOUR_PUSHWOOSH_APP_ID_HERE”);
}

For iOS make sure you use custom Info.plist and add the following information there:

<key>Pushwoosh_APPID</key>
<string>YOUR_PUSHWOOSH_APPLICATION_ID</string>

For Android make sure you use custom AndroidManifest.xml provided at https://github.com/Pushwoosh/pushwoosh-marmalade/blob/master/MarmaladeSample/AndroidManifest.xml

In the same manifest change the value of “PW_APPID” to your Pushwoosh Application ID. Also change the value of PW_PROJECT_ID to your GCM Project Number. The GCM Project Number is a number but make sure you prefix it with the letter “A” or "\ " as in the example below:

<meta-data android:name="PW_APPID" android:value="YOUR_PUSHWOOSH_APPLICATION_ID" />
<meta-data android:name="PW_PROJECT_ID" android:value="\ GOOGLE_PROJECT_NUMBER" />

For Windows Phone make sure you have enabled ID_CAP_PUSH_NOTIFICATION capability in your project.

deployments
{
     wp8-ext-capabilities =ID_CAP_PHONEDIALER, ID_CAP_IDENTITY_DEVICE, ID_CAP_PUSH_NOTIFICATION, ID_CAP_WEBBROWSERCOMPONENT
}

That’s it! How easy is that?

Marmalade SDK

Integrating Pushwoosh SDK into your Marmalade project