React Native send email with link to web app or mobile app - react-native

I am trying to implement deep linking into this app. The app is a React Native Expo app, and is served on web, iOS and Android. There are a bunch of things we want to achieve with this i.e. link to specific things in the app such as certain messages etc. But currently my primary focus is just to navigate to general screens like 'Home', 'Messages', 'Login' etc.
I have been testing and so far, I can enter the URIs such as exp://host:port/--/login and they work as expected.
However, I know and understand that this will not work in a web browser on my laptop for example.
So my question is, how do I send an email to a user let's say after they have verified their account, prompting them to login, with a link that will for one, take them to the web app if they are on desktop, and two open the mobile app if they have it installed on their phone?
And just as an example, let's imagine my deep link URI is myapp://login
Thanks for any help.
EDIT
After looking around some more, I am deciding to consider the possibility of linking to the web app, and upon the web app loading, linking to the mobile app if they have it installed.
Given this, what is the best way to handle this?

You can follow one of the next approaches.
Validate the request origin and based on that generate the link for
an specific platform.
Generate as much links as platform are currently serving you app.
Like: Link to iOS, Link to Android and Link To web
You can design image buttons for each one to make it prettier

Related

How do I open the deep link in mobile browser rather than mobile app in react native

What I am trying to do is opening a deep link in mobile browse (Not in app). Deeplinking is all set up, all the links with specific domains are opening/navigating into app opened from any where else. Now here is a scenario that there are some particular links with same domain (I set up deeplinking for), I want to open that in browser because I don't have any view to show for that link in my app so I want them open in browser.
I have identified the links but when I opened these links via Linking.openUrl it navigates me to the app.
if (lowerUrl.includes(PostType.NO_DEEP_LINK)) {
Linking.openURL(lowerUrl);
return null;
}
Is there any method I can specify the Linking method to open url in mobile browser not in app although the url has a same domain that is setup for deep linkg.
Solution 1#
The best possible solution for that can be using android:pathPattern in android manifest. Basically you have to provide path pattern (a sort regex) to match the valid links.
Documentation for that can be found here.
https://developer.android.com/guide/topics/manifest/data-element
Solution # 2
One has to make RN Native Module and instead Linking.openURL(lowerUrl) to handle this kind of scenario.
To make browser native module one can take help from here.
This solution doesn't work with devices which lacks google play services like Kindle Fire, etc

How should Google Analytics 4 be used with react native application?

We have a website, and a react-native based iOS and Android apps that present that website in a mobile app (with push notifications). If we have the website send the messages through a single G- measurement id, in GA dashboard it shows web as the platform 100% of the time. Is the best way to manage the platform value to create multiple streams? We have different apps for different audiences, so it would be hard to maintain that many new multiple streams for each app. Is there a way to populate Platform in a different way?
I see when we are in the app, the browser value is like Safari (in-app) or Android Webview. But that doesn't tell us app or if the website is in a social media app. I am thinking the best way to proceed is to make a custom dimension for knowing if the user is inside the app. Is that the best way forward for us?

How to get the URI scheme of any app for AppLinks/universal linking?

I need to open a third-party app from my react native mobile app. I understand that this is called universal linking on iOS and AppLink on Android.
I have done a lot of research for this, and I have been able to set up a link to the third party app on the app store. Now I just need to get my app to open up the app if the user has it installed. That requires the URI scheme of the other app, though.
My question is, how do I get the URI scheme to this third party app? Rather, how do I get the URI scheme of any app? I know the URI scheme of the twitter app is 'twitter://app', but the app I am trying to link to is way more niche than twitter or other popular apps, so there is no help for this sort of thing online.
Any tips?
Finding the URL scheme of an iOS app
Due to Apple's tendency for secrecy, it's not easy to find the URL scheme of an iOS app. But it can be done. Here's how I do it, using a Mac app called iMazing.
Launch iMazing, select a connected iOS device, click Apps:
In the footer of the window, click Manage Apps:
Select the app you're interested in , then select Export .IPA menu item. Note: You may need to download the app first.
The saved file will have the .ipa extension. Change the extension to .zip, and unzip the file. You now have a directory with the name matching the app's name.
Assuming "asana" is the app name, open the file "asana/Payload/asana.app/Info.plist" in a text editor, and search for a section that contains "CFBundleURLSchemes". Assuming the app contains CFBundleURLSchemes (they are optional), it should look something like this:
The URL scheme is in the <string>asana</string>, so the complete url scheme in this case is "asana://". Test that the URL launches the app by typing it into iOS Safari browser window. If it works, Safari should display an alert like this:
What About Apps Without CFBundleURLSchemes?
I haven't found a way to launch apps without CFBundleURLSchemes directly, but you can link to the app's page in the App Store, where the user can open the app with the Open button (or Get button if the app is not installed).
You will need to obtain the app page's URL from the App Store:
Open App Store, go to the app's page, click the share icon:
Click Copy Link:
The URL will look like this:
https://apps.apple.com/us/app/asana-organize-tasks-work/id489969512
Clicking on that link in Safari will bring up the app page in the App Store.
Maybe it is worth to start with some background:
There are various ways to deep link into an app, and it depends on the platform (iOS\Android\WindowsPhone...) and its version.
On iOS, up until version 9, the way to open an app was by using URI schemes, e.g. the one you added above: twitter://app. Each app declares the scheme that should be used. Therefore in order to deep link into the app you wish to open, you'll need to use the scheme that it declared. This is the same for Android until version 6.
Starting iOS9+, Apple introduced Universal Links as the method for deep linking. Here's some information: https://developer.apple.com/ios/universal-links/
In these versions, URI schemes won't longer work when using Safari browser (which is the iOS default browser) if the app is not installed. If the app is installed, however, URI schemes should allow opening the app, if everything is configured successfully. In Android there's a similar method called "AppLinks".
Having said this, the above information is for setting deep link for your app. I do not think that it is a common use case to open a third party app from your app - deep links are configured and used by the app owner (e.g. for publishing his\her app to engage users).

Using Branch links to deeplink to unpublished app

I'm working as a web developer for a start-up that has a andriod app prototype. I'm not an app developer ( still learning) so I'm a little unsure how to approach this.
I wanted to deeplink the app to the webpage. I came across this solution called Branch.io . It looks like exactly what we need but I'm not sure how to link it with an unpublished app. Maybe I'm missing something. Any advice would be greatly appreciated.
The Branch service actually doesn't depend on the App or Play Store at all. The link will first try to open up the app, but fallback to the store pages if not installed. You can override this fallback to any website, and the links will still function as usual.
To test an app not in the Play Store, first choose 'Custom URL' in the Link Settings dashboard, and fill in the page you'd like to send users when the app is not installed. It's common for people to send users to either their home page or TestFlight app.
Then, to test the deep linking through install and download tracking, just do the following:
Create a Branch link
Click it on your phone or on simulator and wait to be redirected
Run the app from Android Studio/Eclipse
Here are some more testing considerations. Happy linking.

iOS App with web contents got rejected even the similar one is in appstore

I have developed a native iOS application based on client's requirement to show the timelines of different social networks (FB, Twitter, Instagram, Google + etc.) in the same application using a webview.
Say for example, when I click Facebook button it will show the web contents of Facebook and so. The client gave me a reference app which is doing the same thing and published in the appstore.
That is https://itunes.apple.com/sa/app/mysocial-for-ios/id687623816?mt=8
(Is it not a native app ?)
But when I tried to publish the similar app into appstore,it got rejected. I got the same reason mentioned in the link http://www.sencha.com/forum/archive/index.php/t-215050.html?s=b15f82172b608c468a36774a93c7a7c9
Could you just tell me what is wrong and why the other app got published and what to do for publishing it to the appstore.
Firstly according to the Apple rules any Application who uses Webview or Webkit with just loading links & with not any other features will get rejected immediately.
I did checked reference application you shared it presented & controlled in a way that doesn't looks like an web view based Application. May be they have developed it on any cross platform.
And there is possibility if they are using the web components to load the links but they are using it smartly & they are making it controllable. So there are every chances you can make proper research & try to get the idea how you can utilise the web components smartly & try to make similar application.
Important Note :
The most prior thing is it should be user friendly & easy navigation for users.
Hope this helps to everyone.