Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
3
Erster Beitrag:
vor 3 Monaten, 1 Woche
Letzter Beitrag:
vor 3 Monaten, 1 Woche
Beteiligte Autoren:
Ruben Sanchez Peña, Danny Lauwers

WM2x Push Notifications issue [SOLVED]

Startbeitrag von Ruben Sanchez Peña am 05.09.2017 15:20

Hi.

I have an Android App using Firebase Push Notifications at a day time. It works fine, when the notification arrive the app execute and show device notifications with procedure result. All perfect.

The problem is if i want execute the app from launcher (clicking the app icon) it doesn't open and the device log say:

09-05 17:14:10.335: E/StrictMode(2510): class com.clarionero.wm.boletinesoficiales.wdgen.GWDPBoletines_Oficiales$WDLanceur; instances=2; limit=1
09-05 17:14:10.335: E/StrictMode(2510): android.os.StrictMode$InstanceCountViolation: class com.clarionero.wm.boletinesoficiales.wdgen.GWDPBoletines_Oficiales$WDLanceur; instances=2; limit=1

How can i solve this issue?

If i use EndProgram after execute the Push Notifications then the app is launched with issues.

Thank you

Rubén

Edit: The issue was in my code. I had a custom global code where i showed a custom Splash window (i don't liked the default splash windows). I reset the mode WM init app and i define a default splash window and now the app woks fine from Push Notifications and from device launcher. The splash window is only showed from launcher and not when it receive a push notification.

Rubén

Antworten:

Re: WM2x Push Notifications issue

Hi,

There is a startupflag you can check to see if your program is launched normally or from pushnotification. This in order to manage the startup according.


bLaunchedFromPN is boolean = (ExeInfo(exeLaunch) = exePushNotification)


(Find more details in the help)

It should normally be no problem in lauching your app (when it is not running) from an incoming push notification. Depending on the options inside the push notifications the app will start topmost or the app will start silently and then run the registered procedure to handle the content of the push notification.

When your app is already running, the registered procedure for push notifications is just run.

You have to make sure that the app can start (silently) when a push notification is arrived. And also when the user clicks on the app icon. When the application is already active, and the user presses the app icon, the application is just shown top most.

I have an app on Android, receiving lots of push notifications. So concept is working perfectly.

!! I Do run the Old GMC instead of Firebase at this moment. Still needs to 'upgrade' to firebase.

Hope this helps
Danny

von Danny Lauwers - am 05.09.2017 15:29

Re: WM2x Push Notifications issue

Hi Danny, thank you for your response.

I yet contemplate all your recommendations and Push works fine, it's very easy to implement it.

IF ExeInfo(exeLaunch) exePushNotification THEN
// Executed by Launcher
...
...
...
ELSE
// Executed by Push
...
...
...
END


The issue is when the push is executed and i show the notifictions to user. The app continue running by the notifications tu user and when i want open it from launcher then it doesn't open and show the errors in device log.

Rubén

von Ruben Sanchez Peña - am 05.09.2017 15:53
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.