overwolf.campaigns.crossapp API
Use this API to allow crossapp-promotions.
One app can promote another app and then get an indication for a successful conversion.
For example - an app can promote a video capture and sharing app and receive a notification as soon as the user shares a video from the promoted app.
Note that the Achievement Rewards app will only work on the Overwolf Client version 0.156.0.16 and above.
Methods Reference
- overwolf.campaigns.crossapp.getAvailableActions()
- overwolf.campaigns.crossapp.set()
- overwolf.campaigns.crossapp.reportConversion()
- overwolf.campaigns.crossapp.consumeConversions()
Events Reference
Types Reference
- overwolf.campaigns.crossapp.CrossAppCampaign Object
- overwolf.campaigns.crossapp.CrossAppCampaignConversion Object
- overwolf.campaigns.crossapp.GetCrossAppAvailableActionsResult Object
- overwolf.campaigns.crossapp.GetCrossAppConversionsResult Object
getAvailableActions(callback)
Version added: 0.158
Receive all cross-app actions that target the currently running extension.
Parameter | Type | Description |
---|---|---|
callback | (Result: GetCrossAppAvailableActionsResult) => void | Returns an array of cross-app actions |
set(campaign, callback)
Version added: 0.158
Initiate or modify a cross-app campaign action for this extension.
You may modify an existing action by using the same id parameter. See CrossAppCampaign.id.
Parameter | Type | Description |
---|---|---|
campaign | CrossAppCampaign object | |
callback | (Result) => void | Reports success or failure. |
Callback argument: Success
Returns with the code
{"success":true}
reportConversion(conversionInfo, callback)
Version added: 0.158
Submit new conversion for a cross-app campaign.
Parameter | Type | Description |
---|---|---|
conversionInfo | CrossAppCampaignConversion object | |
callback | (Result) => void | Reports success or failure. |
Callback argument: Success
Returns with the code
{"success":true}
consumeConversions(callback)
Version added: 0.158
Consume all pending conversions for this extension. Consumed conversions are deleted.
Parameter | Type | Description |
---|---|---|
callback | GetCrossAppConversionsResult object |
onAvailableActionUpdated
Called when an available action has updated (or added), with the following structure: CrossAppCampaign Object.
Version added: 0.158
Fired when current extension campaign is updated.
GetCrossAppAvailableActionsResult Object
Parameter | Type | Description |
---|---|---|
success | boolean | inherited from the "Result" Object |
error | string | inherited from the "Result" Object |
actions | CrossAppCampaign[] |
Example data: Success
{"success":true, "actions":[]}
CrossAppCampaign Object
Container that represent a shared data parameters.
Parameter | Type | Description |
---|---|---|
id | string | An id to identify the campaign (action/conversion). See notes. |
action | string | The type of action this cross-app campaign supports.This is a free-text string. |
expiration | number | Expiration date expressed in milliseconds since epoch (Unix Time, UTC). See notes. |
owner_app_uid | string | The UID of the app that owns the targeted cross-app campaign. Optional |
target_apps_uids | string[] | An array of app UIDs this cross-app campaign targets. Optional |
data | object | Information about the cross-app campaign. See notes. |
Example object data
{
"id": "xxxxxx_bbbbbbDxk", // fake
"action": "ar-invite",
"expiration": 1735733700000,
"target_apps_uids": ["*"],
"data":
{
"name": "ar-campaign", // fake
"iconUrl": "overwolf-extension://lkjsndfnnnnd.../campaigns/xxxxxx_bbbbbbDx/icon.svg",
"text": "with The Branded Challenge!"
"textColor": "E6E6E6"
"title": "Win a cool Reward",
"titleColor": "#B2A1E5",
}
}
id notes
"id" should be unique per an extension (two different extensions can use the same id).
expiration notes
e.g. Date.now() or (new Date()).getTime().
data notes
This is a free-form json object that gives more instructions on the required action.
CrossAppCampaignConversion Object
Container that represent a cross app campaign conversions.
Parameter | Type | Description |
---|---|---|
id | string | The ID of the cross-app campaign the conversion targets. |
owner_app_uid | string | The UID of the app that owns the targeted cross-app campaign. |
data | object | Conversion data for the specified action. |
origin_app_uid | object | The UID of the app that performed the conversion (the promoted app). Optional. See notes. |
timestamp | number | When the conversion took place. Optional. See notes. |
origin_app_uid notes
Set by the Overwolf client when calling |consumeConversions|.
timestamp notes
Set by the Overwolf client when calling |consumeConversions|.
GetCrossAppConversionsResult Object
Container that represent a cross app conversions.
Parameter | Type | Description |
---|---|---|
success | boolean | inherited from the "Result" Object |
error | string | inherited from the "Result" Object |
conversions | CrossAppCampaignConversion[] |