PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 21 → Push Notifications
Push Notifications
Débuté par Marius, 30 jan. 2017 22:20 - 1 réponse
//hostimage.webdev.info/avatars/UjH1PuBECdLWUgOQd3lDgg
Membre enregistré
2 messages
Posté le 30 janvier 2017 - 22:20
Hi ,
I am using windev mobile 21.
i got GCM messaging to work with and oracle xe database sending it to the mobile device, but for some reason some of the parameters in the json are not read when it comes through on the mobile side, for example the content (WX_PROP_CONTENT).
Even if i use the following json , (with just my registration id) , i get the message but not any other value or the activate application does not fire. :
{
"registration_ids": ["Aki9 ... yXgt","BTh44 ... iQW)"],
"data":
{
"WX_PUSH_EXT_VERSION":"1.0",
"WX_PROP_TITLE":"Title of the notification",
"WX_PROP_MESSAGE":"Message of the notification",
"WX_PROP_ACTIVATEAPPLICATION":true,
"WX_PROP_FORMAT":
{
"WX_PROP_TYPE":1,
"WX_PROP_CONTENT":"Message of the notification\r\non two lines",
}
}
}

can anybody please help, what am i missing?
thanx
//hostimage.webdev.info/avatars/UjH1PuBECdLWUgOQd3lDgg
Membre enregistré
2 messages
Posté le 31 janvier 2017 - 19:06
After alot of searching i found the problem and thought i should share it.

when pushing the message from the database the specific variables in the payload that windev uses for notification , some of the variables need to be in french and not english, then it works normal.

content := '{' ||chr(10)||
'"registration_ids":["'||v_mc_row.android_api_token||'"],'||chr(10)||
'"data":'||chr(10)||
'{'||chr(10)||
'"WX_PUSH_EXT_VERSION":"1.0",'||chr(10)||
'"WX_PROP_CONTENU":"Messageone",'||chr(10)||
'"WX_PROP_TITRE":"Title of the notification",'||chr(10)||
'"WX_PROP_MESSAGE":"Message of the notification",'||chr(10)||
'"WX_PROP_ACTIVEAPPLICATION":true,'||chr(10)||
'"WX_PROP_AFFICHAGELED":true,'||chr(10)||
'"WX_PROP_FORMAT":'||chr(10)||
'{'||chr(10)||
'"WX_PROP_TYPE":1,'||chr(10)||
'"WX_PROP_CONTENU":"Message of the notification\r\non two lines"'||chr(10)||
'}'||chr(10)||
'}'||chr(10)||
'}';

and not like the documentation says in english .

thanx