iOS Question How to identify that a Push Message arrives

Luiz Fernando Orlandini

Active Member
Licensed User
Longtime User
Hi there,

I could't figure out how to implement a Sub that can identify when a push message arrives.

Looking Apple documentation, I discovered that we can catch that event in application:didReceiveRemoteNotification:fetchCompletionHandler.

How can I implement this event in B4i?
 
Last edited:

Luiz Fernando Orlandini

Active Member
Licensed User
Longtime User
Have you seen B4i tutorial: https://www.b4x.com/android/forum/threads/push-notifications.48562/

It is clearly explained there.
Sorry Erel, but I need to identify that message arrives at device when Application is in background!


So... How can I identify that a new push notification just arrived in the device, without starts the application.

My scenario is: I received a new message, and I need to inform my servers that this message was delivered to user. When user opens the notification, I will update the message status to readed.

Any thoughts?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Your app is not started when a message arrives. So you can't do anything at that point. Only when the user presses on the notification your app will start.

However as it is you who are sending the message to the user you can track this information. You should treat push messages as a way to tell the user that there is new information available. Only when the user goes to your app and "reads" the message in your app you should mark it as read.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…