question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS handlePushMessage

See original GitHub issue

Hi All,

First off, thanks to all who contribute to this project.

I recently implemented push notifications through Intercom and I’m receiving them successfully on my test device. I’m trying to send push messages with an iOS link to open a specific screen in my app and I’m not sure how/where to put my routing logic.

I see there is a method called handlePushMessage, but I don’t see any documentation on how to use it. I’m trying something like this:

AppState.addEventListener('change', this.handleAppStateChange)

handleAppStateChange(currentAppState) {
    Intercom.handlePushMessage((a) => {
      console.log('a: ', a)
    })
}

I’m not getting any console log. I’m assuming I should be able to call this method and get back the link that I had set on the push message so I could perform the appropriate routing.

If anyone could steer me in the right direction, I would greatly appreciate it.

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

1reaction
zachrnolancommented, Jul 12, 2017

A little more context:

I’m using branch.io to handle deep linking and have it working with another push notification platform (onesignal). Our goal is to move from one signal to intercom for sending manual push notifications.

I’m able to receive push notifications (using intercom and this library) on both iOS and Android. The only difference is the handling of the deep link. Android just worked out of the gate, so when I tap on the push notification, it takes me to the correct screen in the app. For iOS, tapping the push notification only opens the app and doesn’t carry over the deep link.

0reactions
trudygacommented, Aug 3, 2020

@ZeerakHameem32 , If the application is opened by the deep link you can access getInitialUrl method of the Linking module. See docs here.

import { Linking } from 'react-native';

const initialUrl = await Linking.getInitialURL();

handleLink(initialUrl); // handle Link in this function 

If you have configured everything correctly this should work. I hope this helps you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Notifications and Notification-Related Actions
Deliver notifications that wake your app and update it in the background. PushKit. Respond to push notifications related to your app's complications, file ......
Read more >
How to handle push notification in swift? - ios - Stack Overflow
To handle push notifications when arrived in your iOS application is tricky part in order to take their full advantage.
Read more >
Push Notifications Tutorial: Getting Started - RayWenderlich.com
Note: This tutorial covers the basics of how to use push notifications for iOS. For an in-depth look and all the details you...
Read more >
How to Add Push Notifications into an iOS App - OneSignal
Follow this step-by-step guide to add push notifications to your iOS app for free with OneSignal.
Read more >
Handling iOS Push Notifications: The Not So Apparent Side
The app must specify what capabilities it supports. To receive push notifications, the “Push Notifications” capability must be turned on.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found