does this support deep linking into your app?
hsavit1 opened this issue · 8 comments
all of the examples show deep linking from your app into another app, for example - like launching facebook. how about deep linking into your own app? does this support that too?
Ey @hsavit1, yeah! The Facebook scheme was an example. Try out your own link!
Add deep link support to your iOS app:
1.- Make sure you have a URL scheme registered for your app in your Info.plist
2.- Add this to your AppDelegate.m
#import "RCTLinkingManager.h"
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url
sourceApplication:sourceApplication annotation:annotation];
}
// Only if your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
For Android:
https://developer.android.com/training/app-indexing/deep-linking.html#adding-filters
More info: https://facebook.github.io/react-native/docs/linking.html
@luisfcofv thanks for the reply
so I'm still a bit confused. could you possibly add an example to the guide that shows how to handle a deep link into your app?
what is the difference between a scheme and a route?
@hsavit1 I updated the README and the example code, try to run the example provided (Only iOS works at the moment).
When the app is installed, go to safari and enter a supported deep link into the address bar.
The supported deep links in the example are: example://test
, example://test/:id
& example://test/:id/details
.
Entering the link example://test/100/details
will open the app.
Hope this is clear enough, let me know how it goes.
Cheers.
hello @luisfcofv
all steps are clear for me, and it's workig in the way is described, but...always but
I need to send email with link that open my app, and if I in link send prefix as example:// , the webView not parse link as html... and if I send it without "://" I get link but not opening my app
Pls. help
ty
Hi @franj0, this seems more like a format issue with your email app. Have you tried to wrap it in a html hyperlink tag? Something like <a href="example://route">Open the app</a>
Great! Glad you figure it out