{"__v":15,"_id":"55a9046fc8bd450d000dd152","category":{"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","_id":"55b9ff4604775a2f00628073","pages":[],"__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-30T10:41:10.427Z","from_sync":false,"order":18,"slug":"marmalade","title":"Marmalade"},"parentDoc":null,"project":"5540ce1b31827a0d007ab1cc","user":"55a5003a750a9a23005332b6","version":{"__v":31,"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-17T13:34:39.406Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Supports iOS, Android, Windows Phone\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Pushwoosh extension requires at least Marmalade v8.3.0p2 for Android platform\"\n}\n[/block]\n**[Download SDK](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/s3ePushWoosh)**\n[**Download Sample**](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/MarmaladeSample)\n**[Extension API Docs](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/Documentation)** \n\nTo integrate Pushwoosh into your Marmalade application you need to do simple following steps:\n\n1. Download the [Marmalade Pushwoosh s3e extension](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/s3ePushWoosh).\n\n2. Include the extension in your **mkb** file by adding s3ePushWoosh subproject: subproject ../s3ePushWoosh\n\n3. Add the following push notifications callbacks in your code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"int32 OnPushRegistered(char* token, void* userData)\\n{\\n    //TODO: handle push notifications registration here\\n    return 0;\\n}\\n \\nint32 OnPushReceived(char* text, void* userData)\\n{\\n    //TODO: handle push notifications here\\n    //push notifications comes as JSON string payload:\\n    //    {\\\"aps\\\":{\\n    //            alert = \\\"Hello from Pushwoosh!\\\";\\n    //            sound = default;\\n    //        },\\n    //        \\\"onStart\\\":1\\n    //    }\\n    return 0;\\n}\\n \\nint32 OnPushRegisterError(char* error, void* userData)\\n{\\n    //TODO: handle push registration error here\\n    return 0;\\n}\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\n4. In your main function add:\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Windows Phone\",\n  \"body\": \"Do not forget to put your correct Pushwoosh App ID instead of ENTER_YOUR_PUSHWOOSH_APP_ID_HERE!\\n\\nYou can ignore this parameter for other platforms.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"if (s3ePushWooshNotificationsAvailable())\\n{\\n    s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_SUCCEEDED, (s3eCallback)&OnPushRegistered, 0);\\n    s3ePushWooshRegister(S3E_PUSHWOOSH_MESSAGE_RECEIVED, (s3eCallback)&OnPushReceived, 0);\\n    s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_ERROR, (s3eCallback)&OnPushRegisterError, 0);\\n \\n    s3ePushWooshNotificationRegister(“ENTER_YOUR_PUSHWOOSH_APP_ID_HERE”);\\n}\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\nFor **iOS** make sure you use custom Info.plist and add the following information there:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<key>Pushwoosh_APPID</key>\\n<string>YOUR_PUSHWOOSH_APPLICATION_ID</string>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\nFor **Android** make sure you use custom **AndroidManifest.xml** provided at https://github.com/Pushwoosh/pushwoosh-marmalade/blob/master/MarmaladeSample/AndroidManifest.xml\n\n In the same manifest change the value of the **“PW_APPID”** property to your **Pushwoosh Application ID**. Also change the value of the **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.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<meta-data android:name=\\\"PW_APPID\\\" android:value=\\\"YOUR_PUSHWOOSH_APPLICATION_ID\\\" />\\n<meta-data android:name=\\\"PW_PROJECT_ID\\\" android:value=\\\"\\\\ GOOGLE_PROJECT_NUMBER\\\" />\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nFor **Windows Phone** make sure you have enabled **ID_CAP_PUSH_NOTIFICATION** capability in your project.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"deployments\\n{\\n     wp8-ext-capabilities =ID_CAP_PHONEDIALER, ID_CAP_IDENTITY_DEVICE, ID_CAP_PUSH_NOTIFICATION, ID_CAP_WEBBROWSERCOMPONENT\\n}\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\nThat’s it! How easy is that?","excerpt":"How to integrate Pushwoosh SDK into your Marmalade project","slug":"marmalade-sdk","type":"basic","title":"Marmalade SDK"}

Marmalade SDK

How to integrate Pushwoosh SDK into your Marmalade project

[block:callout] { "type": "success", "title": "Supports iOS, Android, Windows Phone" } [/block] [block:callout] { "type": "warning", "body": "Pushwoosh extension requires at least Marmalade v8.3.0p2 for Android platform" } [/block] **[Download SDK](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/s3ePushWoosh)** [**Download Sample**](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/MarmaladeSample) **[Extension API Docs](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/Documentation)** To integrate Pushwoosh into your Marmalade application you need to do simple following steps: 1. Download the [Marmalade Pushwoosh s3e extension](https://github.com/Pushwoosh/pushwoosh-marmalade/tree/master/s3ePushWoosh). 2. Include the extension in your **mkb** file by adding s3ePushWoosh subproject: subproject ../s3ePushWoosh 3. Add the following push notifications callbacks in your code: [block:code] { "codes": [ { "code": "int32 OnPushRegistered(char* token, void* userData)\n{\n //TODO: handle push notifications registration here\n return 0;\n}\n \nint32 OnPushReceived(char* text, void* userData)\n{\n //TODO: handle push notifications here\n //push notifications comes as JSON string payload:\n // {\"aps\":{\n // alert = \"Hello from Pushwoosh!\";\n // sound = default;\n // },\n // \"onStart\":1\n // }\n return 0;\n}\n \nint32 OnPushRegisterError(char* error, void* userData)\n{\n //TODO: handle push registration error here\n return 0;\n}", "language": "cplusplus" } ] } [/block] 4. In your main function add: [block:callout] { "type": "warning", "title": "Windows Phone", "body": "Do not forget to put your correct Pushwoosh App ID instead of ENTER_YOUR_PUSHWOOSH_APP_ID_HERE!\n\nYou can ignore this parameter for other platforms." } [/block] [block:code] { "codes": [ { "code": "if (s3ePushWooshNotificationsAvailable())\n{\n s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_SUCCEEDED, (s3eCallback)&OnPushRegistered, 0);\n s3ePushWooshRegister(S3E_PUSHWOOSH_MESSAGE_RECEIVED, (s3eCallback)&OnPushReceived, 0);\n s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_ERROR, (s3eCallback)&OnPushRegisterError, 0);\n \n s3ePushWooshNotificationRegister(“ENTER_YOUR_PUSHWOOSH_APP_ID_HERE”);\n}", "language": "cplusplus" } ] } [/block] For **iOS** make sure you use custom Info.plist and add the following information there: [block:code] { "codes": [ { "code": "<key>Pushwoosh_APPID</key>\n<string>YOUR_PUSHWOOSH_APPLICATION_ID</string>", "language": "xml" } ] } [/block] 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 the **“PW_APPID”** property to your **Pushwoosh Application ID**. Also change the value of the **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. [block:code] { "codes": [ { "code": "<meta-data android:name=\"PW_APPID\" android:value=\"YOUR_PUSHWOOSH_APPLICATION_ID\" />\n<meta-data android:name=\"PW_PROJECT_ID\" android:value=\"\\ GOOGLE_PROJECT_NUMBER\" />", "language": "java" } ] } [/block] For **Windows Phone** make sure you have enabled **ID_CAP_PUSH_NOTIFICATION** capability in your project. [block:code] { "codes": [ { "code": "deployments\n{\n wp8-ext-capabilities =ID_CAP_PHONEDIALER, ID_CAP_IDENTITY_DEVICE, ID_CAP_PUSH_NOTIFICATION, ID_CAP_WEBBROWSERCOMPONENT\n}", "language": "cplusplus" } ] } [/block] That’s it! How easy is that?