### Perform Magento setup and deployment Source: https://docs.xtremepush.com/docs/magento-2 Execute system upgrades, dependency injection compilation, and static content deployment after module installation. ```shell sudo php -d memory_limit=-1 bin/magento setup:upgrade sudo php -d memory_limit=-1 bin/magento setup:di:compile sudo php -d memory_limit=-1 bin/magento setup:static-content:deploy -f ``` -------------------------------- ### Enable session start tracking Source: https://docs.xtremepush.com/docs/android-events Configure the PushConnector to track session starts by calling setEnableStartSession before initialization. ```java // INITIALISE THE XTREMEPUSH CONNECTOR HERE mPushConnector = new PushConnector.Builder("XTREME_PUSH_APP_KEY", "GOOGLE_PROJECT_NUMBER") .setEnableStartSession(true) .create(this); ``` -------------------------------- ### Install Plugin with Attribution Support Source: https://docs.xtremepush.com/docs/phonegap Use this command to install a version of the plugin that includes IDFA and Android ID collection frameworks. ```bash cordova plugin add https://github.com/xtremepush/XtremePush-Phonegap#master+attributions ``` -------------------------------- ### List Devices Request Examples Source: https://docs.xtremepush.com/apidocs/list-2 Examples of JSON request bodies for filtering devices by creation time or retrieving the most recent device. ```json { "apptoken": "YOUR_APPTOKEN", "condition": [ [ "create_time", ">=", "1420070400" ] ], "offset": "0", "limit": "50" } ``` ```json { "apptoken": "YOUR_APPTOKEN", "order": "id DESC", "offset": "0", "limit": "1" } ``` -------------------------------- ### Install CocoaPods dependencies Source: https://docs.xtremepush.com/docs/ios-sdk-import Run this command in your terminal to install the specified pods. ```bash pod install ``` -------------------------------- ### Create segment response examples Source: https://docs.xtremepush.com/apidocs/create-segment Examples of successful and failed responses when creating a segment. ```json { "code": "200", "success": "True", "message": "Segment successfully created", "model": { "id": "SEGMENT_ID", "project_id": "PROJECT_ID", "title": "Test", "conditions": { "0": { "0": [ "tags", "=", "15_01_04", [ "hits", ">", "5" ], [ "daterange", "between", "2015-01-01 to 2015-01-30", "2015-01-01", "2015-01-30" ] ], "1": [ "app_downloaded", null, null, [ "days_ago", ">", null, null, null, "10" ] ], "2": [ "country", "=", "IE" ], "operator": "AND" }, "operator": "AND" } } } ``` ```json { "code": "400", "success": "False" } ``` -------------------------------- ### List User Profiles Request Examples Source: https://docs.xtremepush.com/apidocs/list-1 Examples of JSON request bodies for filtering and paginating user profiles. ```json { "apptoken": "YOUR_APPTOKEN", "condition": [ [ "email_addressable", "=", "0" ] ], "limit": "50", "offset": "0" } ``` ```json { "apptoken": "YOUR_APPTOKEN", "select": [ "email" ], "condition": [ [ "email_subscription", "=", "0" ], [ "email_addressable", "=", "1" ], [ "email", "is not", null ] ], "order": [ "id ASC", "id" ], "limit": "50", "offset": "0" } ``` -------------------------------- ### Campaign info response example Source: https://docs.xtremepush.com/docs/api-data-monitor Example JSON response for an active campaign template containing push content. ```JSON { "success": true, "code": 200, "model": { "active": 0, "messages": { "1": { "push_text": "Hi {{first_name}}, {{amount}} has been debited from your account. Tap here if you did not approve this." }, "2": { "push_text": "Hi {{first_name}}, {{amount}} has been debited from your account. Tap here if you did not approve this." }, "3": { "push_text": null }, "6": { "push_text": null }, "4": [], "7": [], "8": [], "9": [], "10": [], "11": [] } } } ``` -------------------------------- ### List list items response examples Source: https://docs.xtremepush.com/apidocs/list-list-items Examples of successful and error responses returned by the /list/list-item endpoint. ```json { "success": "True", "code": "200", "data": [ { "list_id": "3621214", "value": "user1" }, { "list_id": "3621214", "value": "user2" } ] } ``` ```json { "success": "False", "code": "400", "message": "General error information", "errors": [ { "text": [ "Detailed information about the specific error" ] } ] } ``` -------------------------------- ### List User Profiles Response Examples Source: https://docs.xtremepush.com/apidocs/list-1 Examples of successful and error response bodies for the list profile request. ```json { "success": "True", "code": "200", "data": [ { "id": "11eb0ca1064e5d178bc7061c72c7ac00", "email": "info@example.com", "email_addressable": "1", "email_subscription": "1", "timezone": "Europe/Dublin" } ] } ``` ```json { "success": "False", "code": "400", "message": "General error information" } ``` -------------------------------- ### Placeholder Token Example Source: https://docs.xtremepush.com/docs/realtime-sport-updates Example of a dynamic placeholder token used to pull data from the incoming feed. ```text {{ payload.event.home_score }} ``` -------------------------------- ### Push delivery error response example Source: https://docs.xtremepush.com/docs/api-data-monitor Example response showing a delivery failure due to application uninstallation. ```JSON { "code": 200, "success": true, "data": [{ "action_id": 759147, "campaign_id": 245624, "create_time": 1464355910, "device_id": 459923, "error_message": "Application is Uninstalled" }], } ``` -------------------------------- ### Initialize Custom HTML Configuration Source: https://docs.xtremepush.com/docs/in-app-custom-html Example of applying multiple configurations and initializing the SDK within a script block. ```HTML ``` -------------------------------- ### Request body example Source: https://docs.xtremepush.com/apidocs/list-segments Example of the JSON body required for the request, including the mandatory apptoken and optional pagination parameters. ```json { "apptoken": "string", "limit": 1, "offset": 1 } ``` -------------------------------- ### Initialize SDK Integration Source: https://docs.xtremepush.com/docs/react-native Execute the automated setup to modify native files and inject initialization code. ```bash npx xtremepush-setup init ``` -------------------------------- ### Install iOS Dependencies Source: https://docs.xtremepush.com/docs/react-native Installs required CocoaPods dependencies for the iOS project. ```bash cd ios && pod install && cd .. ``` -------------------------------- ### Full Application Delegate Integration Source: https://docs.xtremepush.com/docs/ios-inbox Complete implementation example for initializing the SDK and enabling the inbox in the application delegate. ```Objective-C - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // ... [XPush setInboxEnabled:YES]; // ... [XPush applicationDidFinishLaunchingWithOptions:launchOptions]; return YES; } ``` ```Swift func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. //Start - Initialise XPush //... XPush.setInboxEnabled(true) XPush.registerForRemoteNotificationTypes(NotificationSettings.getNotificationSettings()) XPush.applicationDidFinishLaunchingWithOptions(launchOptions) //End - Initialise XPush ``` -------------------------------- ### Install Xtremepush CLI Source: https://docs.xtremepush.com/docs/react-native Add the Xtremepush CLI to your project using npm or yarn. ```bash npm install xtremepush-react-native-cli ``` ```bash yarn add xtremepush-react-native-cli ``` -------------------------------- ### Install Plugin without Location Services Source: https://docs.xtremepush.com/docs/phonegap Use this command to install the plugin while excluding geo-location and beacon frameworks. ```bash cordova plugin add https://github.com/xtremepush/XtremePush-Phonegap#master-geo-beacon ``` -------------------------------- ### Update segment response examples Source: https://docs.xtremepush.com/apidocs/update-segment Examples of JSON responses for successful and error scenarios when updating a segment. ```json { "success": "True", "code": "200", "message": "Segment is successfully updated", "model": { "id": "SEGMENT_ID", "project_id": "PROJECT_ID", "title": "Email subscribed", "conditions": { "0": { "0": [ "email_subscription", "=", "0" ], "operator": "AND" }, "operator": "AND" } } } ``` ```json { "success": "False", "code": "400", "message": "General error information" } ``` ```json { "success": "False", "code": "404", "message": "Not Found" } ``` -------------------------------- ### PushConnector.Builder Configuration Source: https://docs.xtremepush.com/docs/android-sdk-location Methods used to initialize location, geofence, and beacon monitoring during SDK setup. ```APIDOC ## PushConnector.Builder Configuration ### Description Configures location-based features including geofencing and iBeacon monitoring during the initialization of the Xtremepush SDK. ### Methods - `setEnableLocations(boolean)`: Enables or disables general location services. - `setEnableGeo(boolean)`: Enables or disables geofence monitoring. - `setEnableBeacons(boolean)`: Enables or disables iBeacon monitoring. - `setLocationUpdateTimeout(int)`: Sets the interval in seconds for additional GPS checks. - `setLowPowerGeo(boolean)`: Disables additional location checks to save battery. ### Example ```java mPushConnector = new PushConnector.Builder("XPUSH_APP_KEY", "GOOGLE_SENDER_ID") .setEnableLocations(true) .setLocationUpdateTimeout(10) .create(this); ``` ``` -------------------------------- ### Users Topic Payload Example Source: https://docs.xtremepush.com/docs/topic-formats-payload-requirements A concrete example of a user profile update message containing a unique ID, customer ID, and specific attributes. ```json { "user_id": "3e685367-07d5-4d48-93ae-f007ac336605", "customer_id": 12345, "user_attributes": { "customer_tier": "VIP", "email": "[email protected]" }, "timestamp": "2024-09-01 12:00:00.123" } ``` -------------------------------- ### Retrieve push action details Source: https://docs.xtremepush.com/apidocs/info-push Examples of successful responses for different push notification platforms. ```JSON { "success": "True", "code": "200", "model": { "id": "801303567", "project_id": "PROJECT_ID", "application_id": "5471", "campaign_id": "53189363", "trigger_id": "641850501", "message_type": "3", "send_mode": "1", "type": "web", "environment": "chrome", "target_count": "6", "sent_count": "6", "delivery_count": "4", "open_count": "0", "click_count": "0", "error": "0", "create_time": "1617020760", "expiration_time": "1618230360", "message": { "id": "801303567", "cid": "53189363", "title": "Don't miss out!", "alert": "Get a 10% discount now", "url": "https://www.example.com/", "icon": "https://s3.xtremepush.com/application/web_icon_large_5471_5f86csdab68c0b2.png" } } } ``` ```JSON { "success": "True", "code": "200", "model": { "id": "1003204108", "project_id": "PROJECT_ID", "application_id": "5406", "campaign_id": "54019941", "trigger_id": "755580603", "message_type": "2", "send_mode": "1", "type": "android", "environment": "production", "target_count": "15", "sent_count": "14", "processing_count": "0", "error_count": "0", "delivery_count": "0", "open_count": "0", "click_count": "0", "runtime": "0", "error": "0", "create_time": "1628775045", "expiration_time": "1631194245", "encryption": "1", "message": { "value": "key", "id": "1003204108", "cid": "54019941", "xpush": "yes", "title": "Push title", "alert": "Push text goes here" } } } ``` -------------------------------- ### Successful Response: Totals Source: https://docs.xtremepush.com/apidocs/new-users Example of a 200 OK response returning the total count of new users. ```json { "code": "200", "data": { "totals": { "amount": "1015" } }, "success": "True" } ``` -------------------------------- ### Successful list creation response Source: https://docs.xtremepush.com/apidocs/create-list Example JSON response returned when a list is successfully created. ```json { "success": "True", "code": "200", "message": "List is successfully created", "model": { "id": "3810889", "project_id": "PROJECT_ID", "name": "External users", "identifier": "user_id" } } ``` -------------------------------- ### Events topic payload example Source: https://docs.xtremepush.com/docs/topic-formats-payload-requirements A concrete example of a bet event payload including user attributes and event-specific values. ```json { "event": "bet", "user_id": "3e685367-07d5-4d48-93ae-f007ac336605", "customer_id": 12345, "user_attributes": { "customer_tier": "VIP" }, "value": { "bet_id": "3e685367-07d5-4d48-93ae-f007ac336605", "odds": 12.2, "stake": 100.0 }, "timestamp": "2024-09-01 12:00:00.123" } ``` -------------------------------- ### Open URL in Browser Source: https://docs.xtremepush.com/docs/in-app-custom-html Example of using the action method to open an external URL in the device browser. ```JavaScript InAppMessage.action('url_button', 'https://xtremepush.com', 'outside'); ``` -------------------------------- ### setEnableStartSession(boolean enable) Source: https://docs.xtremepush.com/docs/android-events Configures the SDK to track session start events automatically. ```APIDOC ## setEnableStartSession(boolean enable) ### Description Enables or disables the automatic tracking of session start events. This must be called on the PushConnector.Builder before initializing the connector. ### Method `PushConnector.Builder.setEnableStartSession(boolean enable)` ### Parameters - **enable** (boolean) - Required - Set to true to enable session start tracking. ``` -------------------------------- ### Successful creation response Source: https://docs.xtremepush.com/apidocs/create-1 Example response body returned when a tag or attribute is successfully created. ```json { "success": "True", "code": "200", "message": "Tag is successfully created", "model": { "id": "60011986", "project_id": "PROJECT_ID", "title": "first_purchase", "name": "first purchase", "attribute_client": "0", "attribute_profile": "1", "type": "0" } } ``` -------------------------------- ### POST /start/campaign Source: https://docs.xtremepush.com/apidocs/start Starts a paused or stopped campaign using the provided app token and campaign ID. ```APIDOC ## POST /start/campaign ### Description Used to start a paused or stopped campaign. Note that it is not possible to start campaigns in Past status or stopped multi-stage journey campaigns. ### Method POST ### Endpoint /start/campaign ### Parameters #### Request Body - **apptoken** (string) - Required - Your App token - **id** (integer) - Required - The ID of the campaign you want to start ### Request Example { "apptoken": "YOUR_APPTOKEN", "id": "CAMPAIGN_ID" } ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful - **code** (integer) - Status code #### Response Example { "success": "True", "code": "200" } ``` -------------------------------- ### GET /bonus/fetch Source: https://docs.xtremepush.com/docs/bonus-engine-integration-guide Retrieves a list of active promotions or bonuses available in the system. ```APIDOC ## GET /bonus/fetch ### Description Retrieves a list of active promotions or bonuses. ### Method GET ### Endpoint /bonus/fetch ### Response #### Success Response (200) - **id** (string) - The unique identifier of the promotion - **name** (string) - The name of the promotion #### Response Example [ { "id": "183", "name": "Name of Promotion" }, { "id": "184", "name": "Name of Promotion" } ] ``` -------------------------------- ### Campaign Action Response Example Source: https://docs.xtremepush.com/docs/api-data-monitor Example JSON response showing campaign action data, including error messages for failed message deliveries. ```json { "success": true, "code": 200, "data": [{ "action_id": 313049676, "campaign_id": 9661067, "create_time": 1561385901, "error": 1, "error_message": "Required values are not set", "message_params": {"first_name": "Sam", "ref_number": "1234", "user.email": "[[email protected]](mailto:[email protected])"}, "message_type_name": "email" }, { "action_id": 311506802, "campaign_id": 9661067, "create_time": 1561314578, "error": 1, "error_message": "Required values are not set", "message_params": {"user.email": "[[email protected]](mailto:[email protected])"}, "message_type_name": "email" }] } ``` -------------------------------- ### Enable Attribution Tracking Source: https://docs.xtremepush.com/docs/ios-sdk-releases Enables mobile install attribution tracking. Requires the AdSupport.framework. ```Objective-C [XPush setAttributionsEnabled: YES]; ``` -------------------------------- ### Match Started Campaign Content Source: https://docs.xtremepush.com/docs/realtime-sport-updates Template for a match started notification. ```text Match started {{ payload.event.home_team }} - {{ payload.event.away_team }} ``` -------------------------------- ### Attributes condition example Source: https://docs.xtremepush.com/apidocs/segment-modal-properties Example structure for defining attribute-based conditions. ```json [ "tags_attributes", "=", "TAG_ID or TAG_TITLE", ["value", "> / < / = / !=", "some value"] ] ``` -------------------------------- ### Flags condition example Source: https://docs.xtremepush.com/apidocs/segment-modal-properties Example structure for defining flag-based conditions. ```json [ "tags_flag", "=", "TAG_ID or TAG_TITLE", ["status", "=", "on / off"] ] ``` -------------------------------- ### Generate Configuration File Source: https://docs.xtremepush.com/docs/react-native Create the configuration template in the project root. ```bash npx xtremepush-setup generate-config ``` -------------------------------- ### OTP Execute Response Examples Source: https://docs.xtremepush.com/apidocs/otp-execute Standard response formats for successful and unauthorized OTP execution requests. ```json { "requestID": "", "code": "Success" } ``` ```json { "success": "False", "code": "401", "message": "Unauthorized" } ``` -------------------------------- ### Period Start Campaign Content Source: https://docs.xtremepush.com/docs/realtime-sport-updates Template for a second half start notification. ```text Second half started {{ payload.event.home_team }} - {{ payload.event.away_team }} ``` -------------------------------- ### Verify SDK Integration Source: https://docs.xtremepush.com/docs/react-native Run the verification command to check the current project setup and identify potential configuration issues. ```bash npx xtremepush-setup verify --verbose ``` -------------------------------- ### List Devices Success Response Source: https://docs.xtremepush.com/apidocs/list-2 Example of a successful 200 response containing device data. ```json { "code": "200", "success": "True", "data": [ { "id": "DEVICE_ID", "create_time": "1420589115", "open_time": "1420589115", "token": "f40b0df2aa78349918ae1f837275c9233f524bd09ac18fb3cc174e6e80a134ca", "active": "1", "addressable": "1", "type": "ios", "environment": "production", "device_id": "9CEFBF8C-9C9F-4242-ADE5-8942FC67806E", "device_type": "iPhone", "device_model": "iPhone5,2", "device_model_name": "iPhone 5", "device_os": "2002-08-01T00:00:00Z", "name": "Test Device", "timezone": "Europe/Dublin", "country": "IE", "language": "en", "carrier_name": "Vodafone", "app_version": "2026-01-01T00:00:00Z", "lib_version": "i22022015" } ] } ``` -------------------------------- ### Create helper-frame.html Source: https://docs.xtremepush.com/docs/web-sdk-for-amp-pages This file initializes the Xtremepush SDK. Replace 'path/to/sdk.js' with the actual path provided in your Xtremepush platform integration settings. ```html ``` -------------------------------- ### Successful Task List Response Source: https://docs.xtremepush.com/apidocs/list-tasks Example JSON response returned when the task list is successfully retrieved. ```json { "success": "True", "code": "200", "data": [ { "id": "5853", "project_id": "1", "identifier": "profile_import", "params": { "fileId": "11ead35649121a69b6400a5174242624", "profileIdentifier": "1" }, "errors": { "file[columns]": [ "Column 'firstname' is not set to be a profile attribute" ], "file[rows]": [ "Rows must contain identifier (Row 4)" ] }, "create_time": "1596217813", "start_time": "1596217813", "finish_time": "1596217813", "status": "2" }, { "id": "5852", "project_id": "1", "identifier": "profile_import", "params": { "fileId": "11ead35443ecf5b6b6400a5174242624", "profileIdentifier": "1" }, "errors": { "file[columns]": [ "Column 'first.name' is not a recognized user profile field or attribute", "Column 'LTV' is not a recognized user profile field or attribute" ] }, "create_time": "1596216945", "start_time": "1596216946", "finish_time": "1596216946", "status": "2" }, { "id": "62", "project_id": "1", "identifier": "profile_import", "params": { "fileId": "11ea41e98278cd8abd07065d6cbde52a", "profileIdentifier": "1" }, "errors": { "file[rows]": [ "7 Rows must contain identifier ( Row 6, Row 11, Row 13, Row 18, ...)", "9 Rows are duplicates ( Row 12, Row 14, Row 15, Row 19, ...)" ] }, "create_time": "1580228176", "start_time": "1580228176", "finish_time": "1580228176", "status": "2" } ] } ``` -------------------------------- ### Install Cordova Plugin Source: https://docs.xtremepush.com/docs/huawei-application Run this command in your terminal to add the Xtremepush Cordova plugin for Huawei. ```bash cordova plugin add https://github.com/xtremepush/XtremePush-Phonegap#master-huawei ``` -------------------------------- ### Configure Rich Media Notifications Source: https://docs.xtremepush.com/docs/react-native Enable rich media support in the configuration file and run the setup command. ```javascript module.exports = { enableRichMedia: true, devTeam: 'YOUR_APPLE_TEAM_ID', }; ``` ```terminal npx xtremepush-setup ios ``` -------------------------------- ### Break Start Campaign Content Source: https://docs.xtremepush.com/docs/realtime-sport-updates Template for a break start notification including current scores. ```text Half time {{ payload.event.home_team }} ({{ payload.event.home_score }}) - ({{ payload.event.away_score }}) {{ payload.event.away_team }} ``` -------------------------------- ### Enable Debug Mode Source: https://docs.xtremepush.com/docs/react-native Run the initialization command with the DEBUG environment variable set to 1 to output verbose logs during setup. ```bash DEBUG=1 npx xtremepush-setup init ``` -------------------------------- ### Successful response example Source: https://docs.xtremepush.com/apidocs/profile-attribute The structure of a successful 200 OK response containing the requested profile data. ```json { "success": "True", "code": "200", "data": [ { "project_id": "2780", "profile_id": "11eb0ca1610252948bc7061c72c7ac00", "value": "Belle", "attribute_name": "first_name", "user_id": "1234", "update_time": "1633523110" } ] } ``` -------------------------------- ### Initialize the SDK in AppDelegate Source: https://docs.xtremepush.com/docs/ios-sdk-integration Configure the SDK within the application delegate's launch method using your application key. ```Swift func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { XPush.setAppKey("XPUSH_APP_KEY") #if DEBUG // Show Debug logs in debug builds XPush.setShouldShowDebugLogs(true) #endif XPush.applicationDidFinishLaunching(options: launchOptions) return true } ``` ```Objective-C - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [XPush setAppKey: @"XPUSH_APP_KEY"]; #if DEBUG // Show Debug logs in debug builds [XPush setShouldShowDebugLogs:YES]; #endif [XPush applicationDidFinishLaunchingWithOptions:launchOptions]; } ``` -------------------------------- ### Initialize SDK with Geofence and iBeacon Monitoring Source: https://docs.xtremepush.com/docs/android-sdk-location Enable geofence and iBeacon monitoring individually during SDK initialization. ```java mPushConnector = new PushConnector.Builder("XPUSH_APP_KEY", "GOOGLE_SENDER_ID") .setEnableGeo(true) .setEnableBeacons(true) .create(this); ``` -------------------------------- ### Check SDK Initialization Manually Source: https://docs.xtremepush.com/docs/react-native Use grep to search for XtremePush references in Android and iOS source files to confirm the SDK is correctly initialized. ```bash # Android - Check SDK initialization grep -r "XtremePush" android/app/src/main/java/ # iOS - Check SDK initialization grep -r "XtremePush" ios/*/AppDelegate.* ``` -------------------------------- ### List Devices API Response Source: https://docs.xtremepush.com/docs/api-data-monitor Example response for the list devices endpoint showing an array of device objects. ```json { "success": true, "code": 200, "data": [{ "id": 2453832008, "open_time": 1623233688, "active": 1, "addressable": 1, "type": "android", "external_id": null }, { "id": 2452826033, "open_time": 1623134275, "active": 1, "addressable": 0, "type": "web", "external_id": null }] } ``` -------------------------------- ### Configure Android Manifest for Install Referrer Source: https://docs.xtremepush.com/docs/kochava Register the ReferrerReceiver in your Android Manifest to handle install attribution. ```xml ``` -------------------------------- ### Redeem Transaction Payload Example Source: https://docs.xtremepush.com/docs/monitor-user-transactions Example JSON payload sent to an external integration when a user redeems a reward. ```json { "event": "redeem.static", "redeemOptionName": "5c787af5-d28e-4567-809c-b030877d9355", "namespace": "1", "transactionId": "eefa3829-2d0c-4785-ab52-5e10e7eb404e", "userId": "User 123", "price": 200, "productName": "Free Tickets", "address": "address_123", "email": "[email protected]" } ``` -------------------------------- ### Create Filters, Metrics, and Custom Columns Source: https://docs.xtremepush.com/docs/custom-expressions Examples of expressions used to filter rows, calculate percentages, and derive new column values. ```text = contains([comment], "Xtremepush") ``` ```text = share([Bet Amount] > 50) ``` ```text = [Stake Amount] - [Win Amount] ``` -------------------------------- ### POST /create Source: https://docs.xtremepush.com/apidocs/create Creates a new campaign in the system. ```APIDOC ## POST /create ### Description Creates a new campaign with specified settings and channels. ### Method POST ### Endpoint /create ### Parameters #### Request Body - **apptoken** (string) - Required - Your App token - **title** (string) - Required - The title of your campaign - **trigger** (integer) - Optional - The type of campaign to create (0: Scheduled, 1: Geo/iBeacon, 2: Event, 3: Api) - **category_id** (integer) - Optional - The ID of the engagement category - **target_applications** (integer) - Optional - The ID or IDs of the app or site to target - **email** (boolean) - Optional - Enable email message channel - **sms** (boolean) - Optional - Enable sms message channel - **android_push** (boolean) - Optional - Enable push message channel on Android - **ios_push** (boolean) - Optional - Enable push message channel on iOS - **ios_push_production** (boolean) - Optional - Enable push message channel for iOS production builds - **ios_push_sandbox** (boolean) - Optional - Enable push message channel for iOS dev builds - **web_push** (boolean) - Optional - Enable web push message channel - **web_push_chrome** (boolean) - Optional - Enable web push messaging for Chrome and Opera - **web_push_firefox** (boolean) - Optional - Enable web push messaging for Firefox - **web_push_safari** (boolean) - Optional - Enable web push messaging for Safari - **inbox** (boolean) - Optional - Enable inbox message channel - **webhook** (string) - Optional - Enable webhook message channel - **encryption** (integer) - Optional - Encryption setting (0: Off, 1: Use where possible, 2: Enforce) ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful - **code** (integer) - Status code - **message** (string) - Success message - **model** (object) - The created campaign object #### Error Response (400) - **success** (boolean) - Indicates failure - **code** (integer) - Status code - **message** (string) - Error message ``` -------------------------------- ### Successful Campaign Creation Response Source: https://docs.xtremepush.com/apidocs/create Example of a 200 OK response returned when a campaign is successfully created. ```json { "success": "True", "code": "200", "message": "Campaign is successfully created", "model": { "id": "58943956", "project_id": "PROJECT_ID", "type": "1", "trigger": "0", "send_type": "0", "active": "1", "sending": "0", "draft": "0", "status": "0", "is_open": "0", "title": "API example", "ab": "0", "languages_multi": "0", "content_fetch": "0", "encryption": "0", "ios_push": "0", "ios_push_production": "0", "ios_push_sandbox": "0", "ios_push_legacy": "0", "android_push": "1", "android_push_production": "1", "android_push_legacy": "0", "web_push": "1", "web_push_safari": "0", "web_push_chrome": "1", "web_push_firefox": "1", "inbox": "0", "inbox_only": "0", "inbox_same": "0", "inbox_addressable": "0", "inapp": "0", "inapp_ios": "0", "inapp_android": "0", "onsite": "0", "email": "1", "email_addressable": "0", "sms": "0", "webhook_addressable": "0", "broadcast": "0", "conversions": "0", "retry_for": "4", "retry_for_period": "weeks", "activate_time": "1779457650", "last_modified": "1779457650", "redemptions": "0", "automatically_pick_winner": "0", "automatically_pick_winner_sample_percentage": "100", "throttling": "0", "create_time": "1779457650", "custom_variant_share": "0", "early_cancel_event_filter": "0", "target_authorised_devices": "0", "voucher_codes_enabled": "0", "consent_preference": "0", "qualification": "0", "enter_journey_once_ever": "0", "enter_journey_once_at_a_time": "0", "mxa_migration": "0", "new_mxa": "0", "prioritise_rcs": "0", "messages": { "2": { "language": "", "push_title": "Android push title", "push_text": "Android push text" }, "3": { "language": "", "push_title": "Webpush title", "push_text": "Webpush text", "push_action": { "action": "url", "url": "https://example.com/" } }, "7": { "email_type": "1", "email_html": "\nTests\n", "email_subject": "Hi {{first_name}}, check out our sample API email test", "email_from_name": "MarĂ­a", "email_from_address": "info@example.com", "email_unsubscribe": "0", "twig": "1" } } } } ``` -------------------------------- ### Open Full-Screen Loyalty View Source: https://docs.xtremepush.com/docs/load-the-widget Launches the loyalty interface as a full-screen view, supporting default, path-specific, and parameterized configurations. ```Java // Open default view mPushConnector.openLoyalty(activity); // Open a specific path mPushConnector.openLoyalty(activity, "THE_PATH"); // Open a specific path with custom parameters JSONObject params = new JSONObject(); params.put("color-mode", "dark"); params.put("lang", "es"); mPushConnector.openLoyalty(activity, "THE_PATH", params); ``` ```Objective-C // Open default view [XPush openLoyalty]; // Open a specific path [XPush openLoyaltyWithPath:@"THE_PATH" params:nil]; // Open a specific path with custom parameters NSDictionary *params = @{ @"color-mode": @"dark", @"lang": @"es" }; [XPush openLoyaltyWithPath:@"THE_PATH" params:params]; ``` ```Swift // Open default view XPush.openLoyalty() // Open a specific path XPush.openLoyalty(withPath: "THE_PATH", params: nil) // Open a specific path with custom parameters let params = [ "color-mode": "dark", "lang": "es" ] XPush.openLoyalty(withPath: "THE_PATH", params: params) ``` -------------------------------- ### Create SMS campaign via cURL Source: https://docs.xtremepush.com/docs/api-create-sms Example request to create a broadcast SMS campaign with personalization tags. ```bash curl --request POST \ --url https://external-api.xtremepush.com/api/external/create/campaign \ --header 'content-type: application/json' \ --data '{ "apptoken": "YOUR_APPTOKEN", "title": "SMS example via API", "sms": 1, "broadcast": 1, "messages": { "9": { "sms": { "from": "xtremepush", "text": "{{first_name}}, check out our SMS API test" } } } }' ``` -------------------------------- ### Tags condition example Source: https://docs.xtremepush.com/apidocs/segment-modal-properties Example structure for defining tag-based conditions with optional hit counts and date modifiers. ```json [ "tags", "=", "TAG_ID or TAG_TITLE", ["hits", "> / < / =", "number of hits"] daterange or days ago (optional) (see examples below) ] ``` -------------------------------- ### Generate Keys with Java Keytool Source: https://docs.xtremepush.com/docs/oauth20 Create a Java KeyStore and convert it to PKCS12 format for use in Java-based environments. ```bash # This command will ask for additional information. In the last step type `yes` and press Enter keytool -genkey -alias -keyalg RSA -keysize 2048 -validity -keystore xtremepush.jks # Import keys from the KeyStore keytool -importkeystore -srckeystore xtremepush.jks -destkeystore xtremepush.p12 -deststoretype PKCS12 ``` -------------------------------- ### Complete Foreground Notification Implementation Source: https://docs.xtremepush.com/docs/mobile-foreground-notifications-handling A full example combining foreground notification registration and custom message response handling. ```Swift // Show OS notifications in foreground XPush.registerForegroundNotificationOptions { (message :XPMessageResponse) in return [.alert, .sound, .badge] } // Register custom message handler XPush.registerMessageResponseHandler { (response: XPMessageResponse) in if response.action.type == .present { // Show an article dialog with "View" button self.showArticleDialog(response.message, clickCallback: { XPush.clickMessage(response.message) }) } } ``` ```Objective-C // Show OS notifications in foreground [XPush registerForegroundNotificationOptions: ^XPNotificationType(XPMessageResponse *response) { return XPNotificationType_Alert | XPNotificationType_Sound | XPNotificationType_Badge; }]; // Register custom message handler [XPush registerMessageResponseHandler: ^(XPMessageResponse * _Nonnull response) { if (response.action.type == XPActionType_Present) { // Show an article dialog with "View" button [self showArticleDialog: response.message viewButtonCallback: ^{ // Process message click [XPush clickMessage:response.message actionIdentifier:nil]; }]; } }]; ``` -------------------------------- ### OTP History List Response Examples Source: https://docs.xtremepush.com/apidocs/otp-history-list Examples of successful and error responses from the OTP History List API. ```json { "success": "True", "code": "200", "data": [ { "otp_id": "01940221-566f-71ad-9702-39b8c8718cab", "integration_id": "9", "profile_id": "11e93ff698f70bb681ec0a22275e6966", "mobile_number": "+380987050091", "request_ts": "2024-12-26T08:42:06Z", "verified_ts": "2024-12-26T08:43:25Z", "source": "1" } ] } ``` ```json { "success": "False", "code": "400", "message": "Invalid request", "errors": [ { "text": [ "Missing or invalid 'apptoken'" ] } ] } ``` -------------------------------- ### Verify SDK Integration Source: https://docs.xtremepush.com/docs/react-native Use the CLI tool to verify the SDK integration status. ```bash npx xtremepush-setup verify ``` ```bash npx xtremepush-setup verify --verbose ``` -------------------------------- ### Create an iOS Send Now Campaign with Conditions Source: https://docs.xtremepush.com/reference/campaign-model Example of a POST request to create a campaign with a specific payload and attribute-based segmentation condition. ```bash curl --request POST \ --url https://external-api.xtremepush.com/api/external/create/campaign \ --header 'content-type: application/json' \ --data '{ "apptoken": "YOUR_APPTOKEN", "title": "El Clasico", "ios_push": 1, "ios_push_sandbox": 1, "push_text": "1-0! Messi scores.", "payload_add": [ { "key": "score", "value": "1-0" } ], "conditions": { "operator": "AND", "0": { "operator": "AND", "0": [ "tags_attribute", "=", "live_scores", [ "value", "=", "on" ] ] } } }' ``` -------------------------------- ### Custom Notification Handling Example Source: https://docs.xtremepush.com/docs/mobile-message-custom-handling A comprehensive implementation showing how to handle message presentation and specific user click actions. ```java @Override public void messageResponseReceived(final Message messagePayload, HashMap responsePayload, final WeakReference uiReference) { switch (responsePayload.get("type")) { // When app is received in the foreground show a custom notification case "present": if (uiReference != null && uiReference.get() != null) { ((Activity) uiReference.get()).runOnUiThread(new Runnable() { @Override public void run() { AlertDialog.Builder builder = new AlertDialog.Builder((Activity) uiReference.get()); builder.setPositiveButton("View", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { //go to article id openArticle(messagePayload.data.get("articleId")); } }); builder.setMessage(messagePayload.text); builder.setTitle(messagePayload.title); AlertDialog dialog = builder.create(); dialog.show(); } }); } break; //when message is clicked case "click": //default click action if (!(responsePayload.containsKey("action"))) { //navigate to article openArticle(messagePayload.data.get("articleId")); } //action for a certain button click else { switch (responsePayload.get("action")) { case "like": //like article likeArticle(messagePayload.data.get("articleId")); break; } } break; } } ``` -------------------------------- ### Error API Response Example Source: https://docs.xtremepush.com/docs/external-api-overview Example of a 400 Bad Request response, including specific field validation errors. ```json { "code": 400, "success": false, "message": "Campaign is not created", "errors": { "text": ["Text cannot be blank."] } } ``` -------------------------------- ### Initialize with Public Key Pinning Source: https://docs.xtremepush.com/docs/android-sdk-integration Include the public key in the PushConnector builder for enhanced security. ```Java new PushConnector.Builder(XPUSH_APP_KEY, GOOGLE_PROJECT_NUMBER) ... .setServerExpectedPublicKey() .create(this); ``` -------------------------------- ### Successful API Response Example Source: https://docs.xtremepush.com/docs/external-api-overview Example of a 200 OK response containing a success message and the associated model data. ```json { "code": 200, "success": true, "message": "Campaign successfully created", "model": { "id": CAMPAIGN_ID, "text": "Testing Campaign is sent to subscribers to 15_01_04", "title": "Flag Test Campaign", .... } } ``` -------------------------------- ### OTP History List Request Examples Source: https://docs.xtremepush.com/apidocs/otp-history-list Examples of JSON request bodies for ordering and filtering OTP history records. ```json { "apptoken": "YOUR_APPTOKEN", "order": [ "profile_id" ] } ``` ```json { "apptoken": "YOUR_APPTOKEN", "condition": [ [ "profile_id", "=", "profileId" ] ] } ``` ```json { "apptoken": "YOUR_APPTOKEN", "order": [ "request_ts DESC" ] } ``` -------------------------------- ### Run iOS Application Source: https://docs.xtremepush.com/docs/react-native Builds and launches the React Native application on an iOS simulator or device. ```bash npx react-native run-ios ``` -------------------------------- ### Cancel quest response example Source: https://docs.xtremepush.com/apidocs/cancel-quest The successful response structure for the cancel quest request. ```json { } ```