iOS Question How to identify that a Push Message arrives

Discussion in 'iOS Questions' started by Luiz Fernando Orlandini, Mar 21, 2015.

  1. Luiz Fernando Orlandini

    Luiz Fernando Orlandini Active Member Licensed 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: Mar 21, 2015
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Luiz Fernando Orlandini

    Luiz Fernando Orlandini Active Member Licensed User

    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?
     
  4. Erel

    Erel Administrator Staff Member Licensed 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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice