Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 10 Monaten, 3 Wochen
Letzter Beitrag:
vor 10 Monaten, 3 Wochen
Beteiligte Autoren:
Danny Lauwers, G-Zac

[WM21] app crashes after receiving push notification

Startbeitrag von G-Zac am 29.07.2017 00:56

Hi everyone,

Why when I send a push notification to my App this crashes. This did not happen a few days ago. When I copy the same procedure in any other test app, it works correctly.

Any suggestions?

Thank you.

Antworten:

Hi,

For more stability,
I have set the Notification Parameter to LOCAL because the OnPushNotificationReceived call back function is called on a new thread and then it is best to use LOCAL parameters because you don't know when the referenced variable is going out of scope in the process that has started the thread and may cause problems.

I Also include a WHEN EXCEPTION DO END so if anything happens in my processing the notification I can catch that and log it.

Don't directly call any GUI stuff in the procedure, you have to call that on the main thread -> This sometimes works, sometimes does not. But you have to check that yourselfs, even in subfunctions that are calles from this push notification function, you have to make sure you only touch the GUI from the main thread.EXECUTEMAINTHREAD

What do you do inside your OnPushNotificationsReceived procedure ?

Danny

von Danny Lauwers - am 31.07.2017 07:00
Quote
Danny Lauwers
Hi,

For more stability,
I have set the Notification Parameter to LOCAL because the OnPushNotificationReceived call back function is called on a new thread and then it is best to use LOCAL parameters because you don't know when the referenced variable is going out of scope in the process that has started the thread and may cause problems.

I Also include a WHEN EXCEPTION DO END so if anything happens in my processing the notification I can catch that and log it.

Don't directly call any GUI stuff in the procedure, you have to call that on the main thread -> This sometimes works, sometimes does not. But you have to check that yourselfs, even in subfunctions that are calles from this push notification function, you have to make sure you only touch the GUI from the main thread.EXECUTEMAINTHREAD

What do you do inside your OnPushNotificationsReceived procedure ?

Danny



Hi, Danny,
I only use the notification to report some action, I do not execute any procedure.

A few days ago it worked without problems, not now.

Any other suggestions?

von G-Zac - am 31.07.2017 21:56
Hi,

No, at the moment. Could you show us the code of the function that handles the push notifications. And can you see what the error message is ? Android logcat ?

Danny

von Danny Lauwers - am 02.08.2017 15:20
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.