•   about 6 years ago

Push Notifications - How to Trigger When App is Closed/Call from REST

Hi there!

I set up my app to use in-app messaging as well as push notificaitions. Is there a way to trigger push notifications when a user's device is closed? I can send them from the web console but am looking for a way to do it programmatically.

Thanks!
Liam

  • 3 comments

  •   •   about 6 years ago

    I have question related to similar thing. Desired behavior is like: message is send. user didn’t received it (he’s not in app, presumably in background). I want to send push notification(iOS), after 10-15 seconds, to wake him up. How can i configure this behavior in sandbox? Is it possible?
    I tried with push notifications from your console, and they’re working, but i want them to be send automatically, after some delay.

    According to your docs, this should be possible, but i’m not receiving any push when i’m in background(unless it’s send via console)

    Thanks for explaining,

  • Manager   •   about 6 years ago

    Thanks for your comments.

    Liam, for your case, we've done something that will make your problem simpler - it happens automatically.

    When you send a message to a user who is not online, we will automatically send a push notification 'wakeup' that will notify your application that there is a message waiting for the user. Your app can now decide how they want to handle this notification.

    ProExe:

    Once you have APNS configured, the push message happens automatically. Make sure that you are handling it in the receiving app in your AppDelegate (assuming you're on iOS).

    Would like to get a little more background on the issue - are you able to push a wakeup from the console?

  •   •   about 6 years ago

    Thanks for the response, Shannph! I'm not seeing the wake-up push come in. I have a breakpoint that triggers when I send regular pushes from the dashboard that works. I am also receiving the incoming messages when the app is open (via the socket connection (if that's what it is)). However, when I close the app I still don't get the ping.

    I think I got one success after calling MMX.stop when my app enters background -- is that how we notify that the user is no longer active (and thus should start receiving push notifs)?

Comments are closed.