React Native - Branch link in an Intercom message opens browser first instead of the app - react-native

I'm finding it hard to get Branch.io deeplinking to work with Intercom.
The Branch link works well when opened via native Messages app - opens the app directly when tapped.
But if we send this link through an Intercom message, and then tap on it on the phone, the result is not as expected:
On iOS
Open Intercom messages view.
Tap on the Branch link (sent from Intercom console).
Browser opens with an alert asking to open the native app ('Open this page in "MyApp"?').
Press "Open".
App detects the Branch parameters on the link and redirects to the correct page.
Expected Behavior
App should detect the link directly without being handed over by browser.
On Android
Open Intercom messages view.
Tap on the Branch link (sent from Intercom console).
List of suggested apps pops up - including "MyApp".
Tap on "MyApp".
App detects the Branch link ONLY, but without the parameters - which then will not redirect to any page.
Now send the app to the background (eg: Tap on home button), and then open "MyApp" again.
Branch will now detect the link with the parameters and redirect to the correct page (this sometimes happens in iOS as well).
Expected Behavior
Branch should detect the link with parameters directly, without the need to send the app to background and reopen.
Does anyone have an idea what I have missed out on? or a workaround?
I was thinking to setup Universal Links by uploading the Association File.. 🤷‍♂️
Btw, Branch.io configurations are all done and works perfectly with other social media apps.
react-native: 0.61.5
react-native-branch: 5.0.0-beta.1
react-native-intercom: 16.0.0

Related

html5 app freezes in ios13 after navigating to an external url in in-app standalone safari browser and back

Issue
My web application built using nuxt and installed as web app on iphone becomes unresponsive after I open or visit an external link from the app. Issue specifically comes iOS 13.4 and above on real devices. Simulators works fine.
Devices
iPhone X and XI (all versions) with iOS 13.4 and above
Steps to reproduce
Open url https://nuxt-min-pwa.netlify.app/ in safari.
Tap on share icon and then add to home screen.
Open app from home screen.
Tap on menu icon.
Tap on second.
Tap on link named ICE.
App will open an external url.
Tap on Back to App button to return to the app.
Tap on second now.
App does not responds. A thin loading bar seems to be in progress, everytime second is tapped. But nothing else happens.
Web app is working fine in iphone8 with ios 13.3.1 and Xcode simulators. There is a similar issue reported on both stack overflow and apple developer forum. Although it specifically mentions microsoft openid, but I am sure, issue comes up with any external url.
PWA freezing on navigation clicks in Safari iOS (13.5) after OpenID Microsoft sign in
https://developer.apple.com/forums/thread/649699
Source code for app
https://github.com/appsbuddha/minimal-nuxt-pwa

Native way to inform user there is a mobile app?

Often when viewing a website on a mobile device you'll get a notification that a mobile app is available, or if you already have the app downloaded you'll have the option to open the URL in the app.
Is there a native way to do this or are these notifications always custom?
When users click on a link or download a file and the suggestion pops up to open the respective app, that's called deep linking. iOS labels it as Universal Links and Android uses App Links.

Branchio Universal Deeplink redirecting to safari and shows popup to launch the application even app is installed in iOS 13.3.1

Even though the Application is installed in the iPhone, tapping Branchio universal deep-link redirecting to safari and shows a popup to launch the application.
Expected: if the application is already installed, tapping deep link should launch the application.
Pre- requests:
OS: iPhone iOS 13.3.1
Release build in Appcenter
Set custom URL to https://install.appcenter.ms/app (Appcenter)
Generate the Universal deeplink
Steps to reproduce:
Generate the Universal deep-link
Using the deep-link install the application
Again Tap on the same deep-link will redirect to Safari and popup alert with CANCEL and OPEN options
Tap OPEN in safari to launch the application
This is an expected behaviour where Apple prompts the user first time if to open the app. Only if universal links are implemented, it does not ask for the second time. Our AASA validator tool (https://branch.io/resources/aasa-validator/) shows the AASA file to validated correctly but while testing on the install page of your redirected website, it is showing a 404 error. So, we are unable to replicate this on our end to check further.
Could you please share your app store link so as to help us out here.
Also, would request to check our documentation here ( https://help.branch.io/developers-hub/docs/ios-troubleshooting#section-validate-if-aasa-file-successfully-downloaded ) so as to confirm if the device is receiving the generated AASA files. This is a known issue with Apple for iOS 13.x+ where the AASA files do not get ingested into the device and causes the link redirection to show a prompt or a fail.

How do I open https URL from One Signal push-notification WITHIN my WebView react-native app?

I've created a React-native app (tested in android) using WebView with the initial URL of my company's website.
I want the user to be able to get redirected to a spesific website's product page (for example https://www.test.com/product/hoodie-with-zipper/) WHEN they clicked the OneSignal push notification with the intended launch URL included in the sent notification. The problem is, I want the user to open the URL with my WebView App, not the browsers.
The features I've implemented and tested so far:
Implemented and Tested WebView (no problems so far)
Implemented and Tested deeplink locally (with android scheme of 'myapp://', no problems so far)
Implemented OneSignal push notification SDK for react-native and its firebase requirements (no problems so far)
As I've mentioned in the point 2 before, I've tried and successfully implemented the deeplink with the android scheme of 'myapp://'. But, when I tried to implement the android scheme of 'https://', the launch URL from OneSignal push notification got opened with browser instead, not my WebView app.
I want the user to be able to get redirected to a spesific website's product page (for example https://www.test.com/product/hoodie-with-zipper/) WHEN they clicked the OneSignal push notification with the intended launch URL included in the sent notification, but it'll be opened with React-native WebView instead of browser.
^ So, what should I do to achieve that?
Thanks in advances.
You should handle this yourself by passing in the URL via additional data in the notification. Then, in your app you should open a webview to the specified url.The Launch URL feature on the dashboard or the url field on the REST API automatically opens the web browser on the mobile device when the notification is tapped on. If you would like to open the URL inside your app instead of the browser, you need to send your notification with custom data that can read by your app's SDK. If you're using our dashboard to send notifications, the sending notification options allows you to include additional data to be sent with your notification. If you're using our API to send notifications, you can set the 'data' field to a JSON object hash of extra custom data. For example, you could set targetUrl for the key and https://google.com as the value. Then in your app's code read the targetUrl value from additionalData in the NotificationOpened callback (name depends on the OneSignal SDK used).

OneSignal React Native Push iOS Universal Linking (avoid WebView)

Using onesignal, When one sets the push notification value "url" for a notificaiton to open in an app, aka universal linking, by default the app is opened and a webview screen emerges (not on android, only iOS - at least in React Native).
I want to ignore this webview. I don't want to open it. The url is supposed to open the app to the corresponding universal link/deep link, not my domain on a web broswer. If I click on a similar link from a non-notificaiton source, it takes me to the screen, why does the push notification not do this?
How do I override this? I can't seem to figure it out. Do I have to manually implement this? Why does it open a webview by default and not the corresponding screen in the app instead?
It seems you have to manually route it if one were to go this route, unfortunately. From what I'm gathering bits here and there.
this is a bad choice to go with if you're using iOS:
https://www.myapp.com/p/fdsafa
this is better:
myapp://p/fdsafa
unfortunately onesignal has it setup in some weird way with the https://www.myapp.com that it makes it useless on iOS, unless your actual intention is to open an actual web url in a webview. Where as myapp:// is compatible with both platforms (just don't put a host on Android, leave the host out, just do the myapp as the schema). Works.