PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Windev Mobile 23 Push Notifications
Windev Mobile 23 Push Notifications
Débuté par WindevCol, 02 mai 2019 04:22 - 6 réponses
Posté le 02 mai 2019 - 04:22
I am trying to implement for the first time in windev mobile a push notification in android and ios. i succesfully did the procedure on the firebase side and downloaded the JSON file.
but when i use the function NotifPushEnable() to register the app on the google servers nothing happens (at least on the emulator) is NotifPushEnable() one of these functions that do not work on the emulator but only on the device itself when the app is deployed ? how do i know that the function did indeed register and send back a token i can put on the database to use later to send the Push notifications ?
Membre enregistré
498 messages
Popularité : +8 (8 votes)
Posté le 02 mai 2019 - 15:35
Hi WindevCol

to make push notification work you need Windev and Windev Mobile
on each of one they are examples to make it work.

what you did it was the first part that is to enable the push notification for the project

now you need to have the ID app of the device, save it on the DB
enable the permission on the app
use this ID and the ID of the project that needs Windev to use the function to send the notification.
and then you will now see a notification.

take in mind that when you send it you will no be able to know it the notification was succesfully show it on the device or not.


sources:
NotifPushSend function only for windev or webdev
https://help.windev.com/en-US/…

what procedure execute when the push show up on the app
https://help.windev.com/en-US/…

Enable the push notification on the app:
https://help.windev.com/en-US/…
(just to have the ID of the app on the device

The examples to search for on Windev Mobile and Windev or Webdev:
WD Push Server
Android Push
iOS Push
WD Send Push

Hope this could help

Now about your question

that procedure only gives you an ID this ID you need to save it on your data base and use it on your function NotifPushSend on windev, theres nothing more, google only give you a canal to send it but they don't do anything more.

--
Best Regards
ARV
Membre enregistré
498 messages
Popularité : +8 (8 votes)
Posté le 02 mai 2019 - 15:37
WindevCol wrote:
> how do i know that the function did indeed register and send back a token i can put on the database to use later to send the Push notifications ?

the only way to know it's that on the procedure launch the error, or the buffer doesn't have anything.
for android I see that it take something to get the ID.

--
Best Regards
ARV
Posté le 02 mai 2019 - 22:26
Thanks Arv but my point is that when i use NotifPushEnable(RegisterPushNotif) with exactly the sample code nothing happens, there is nothing on the buffer and the procedure RegisterPushNotif is never called. That is why i was asking if this is something that you cannot use on the GO function that windev has so you can debug it ? or is this of of those many functions that windev says it will ONLY work when the application is compiled and installed in the hardware. Are you able to see what is on the buffer with a breakpoint and using the windev GO function ?

Thanks for your help
Membre enregistré
498 messages
Popularité : +8 (8 votes)
Posté le 03 mai 2019 - 19:30
Hi WindevCol

Sorry my bad

About your question well not sure about that but I always testing on the device and works really well, never try it on GO with the windev project.
I guess it couldn't work because it's on Windows plataform simulatin a device for android.

Hope this could help and maybe someone have the right answer for your question.

--
Best Regards
ARV
Posté le 04 mai 2019 - 05:02
@ARV Thanks for your help, one last question now that you seem to have a grip on the Push notifications subject. Each phone gets its own ID right ? meaning if you have for example an app that uses a user name and the user install that app in 4 different devices, that user name will have 1 Push Notification ID for each phone (4 IDS in Total), so i need to take that into consideration in the database design for the storage of the ID´S ? Did i understood that right ?
Membre enregistré
498 messages
Popularité : +8 (8 votes)
Posté le 06 mai 2019 - 15:31
Hi WindevCol

and yes you get the idea, you will have in total 4 IDS
something Like

the user have 2 androids and 2 iPhone then he install it you will have now 4 IDs, obviosly they aren't the same.

if you want to send the notifications for the devices you will have to run the NotifSendPush 4 times and also you will have 4 rows of data on your DB.

Hope this could help you.

--
Best Regards
ARV