6
Views
2
Comments
[Pushwoosh Plugin] How to pass the Authorization Token to the SDK ?
Question
pushwoosh-plugin
Mobile icon
Forge asset by Pushwoosh
Application Type
Mobile

Hi,

When calling the RegisterDevice action from a mobile device the call made by the SDK doesn't provide the Authorization Token.

How can be pass the Token to the SDK ?

Here is the call made by the SDK: 

curl -v -X POST 'https://1E239-4A735.api.pushwoosh.com/json/1.3/postEvent' -H 'Content-Type: application/json; charset=utf-8' -H 'Authorization: Token (null)' -H 'Cookie:' -d '{"request":{"userId":"XXXXXXX-22XX-493A-XXXXX-D71XXXXXX","hwid":"XXXXXXX-22XX-493A-XXXXX-D71XXXXXX","timestampUTC":1753714625,"event":"PW_ScreenOpen","timestampCurrent":1753721825,"v":"6.8.5","attributes":{"device_type":"1","screen_name":"FLEXNetworkMITMViewController","application_version":"0.8"},"device_type":1,"application":"1E239-4A735"}}'

And of course the device receive a 401 error...

Thanks in advance for your help.

Renaud

UserImage.jpg
Renaud Diez

In order to pass the Device Token used for the Authorization the following changes needs to be done in the Info.plist file of the app.

To do so, go in LifeTime, select the app you need to modify, click on it and then click on "settings".

  1. Go to the Advanced - Extensibility Configurations section
  2. Select the "Custom" option
  3. Click on the "Copy from default" button
  4. Add the following entries into the content:
    { "name": "Pushwoosh_APPID", "value": "XXXXX-XXXXX" }, { "name": "Pushwoosh_API_TOKEN", "value": "YOUR_DEVICE_TOKEN_FROM_PUSHWOOSH" }


Read the following articles to better understand the change:


https://success.outsystems.com/documentation/11/deploying_apps/override_the_default_mobile_extensibility_configurations/

https://success.outsystems.com/documentation/11/deploying_apps/mobile_apps_packaging_and_delivery/customize_your_mobile_app/extensibility_configurations_json_schema/

2020-03-24 12-18-52
Pushwoosh

Hi, Renaud!

SetApiToken action should be used to set the Pushwoosh device API token:

If you're unable to locate the action, please, update the Pushwoosh plugin used in your project.
The action was added recently in order to increase the security of the SDK.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.