File tree Expand file tree Collapse file tree 7 files changed +60
-5
lines changed Expand file tree Collapse file tree 7 files changed +60
-5
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { Text , View } from 'react-native'
3+ import { Helpers , Metrics } from 'App/Theme'
4+
5+ /**
6+ * This is an example of a container component with a deep link.
7+ */
8+ const DeepLinkingScreen = ( ) => (
9+ < View style = { [ Helpers . fillCenter , Helpers . rowMain , Metrics . mediumHorizontalMargin ] } >
10+ < Text >
11+ This is deep linking example screen which can be accessed using boilerplate://deeplink scheme!
12+ </ Text >
13+ </ View >
14+ )
15+
16+ export default DeepLinkingScreen
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import { Helpers } from 'App/Theme'
77import { useDispatch } from 'react-redux'
88
99const RootScreen = ( ) => {
10+ // Deep linking prefix
11+ const prefix = 'boilerplate://' ;
12+
1013 const dispatch = useDispatch ( )
1114
1215 useEffect ( ( ) => {
@@ -20,6 +23,7 @@ const RootScreen = () => {
2023 ref = { ( navigatorRef ) => {
2124 NavigationService . setTopLevelNavigator ( navigatorRef )
2225 } }
26+ uriPrefix = { prefix }
2327 />
2428 </ View >
2529 )
Original file line number Diff line number Diff line change 11import { createAppContainer , createStackNavigator } from 'react-navigation'
22
33import ExampleScreen from 'App/Containers/Example/ExampleScreen'
4+ import DeepLinkingScreen from 'App/Containers/DeepLinking/DeepLinkingScreen'
45import SplashScreen from 'App/Containers/SplashScreen/SplashScreen'
56
67/**
@@ -15,7 +16,13 @@ const StackNavigator = createStackNavigator(
1516 SplashScreen : SplashScreen ,
1617 // The main application screen is our "ExampleScreen". Feel free to replace it with your
1718 // own screen and remove the example.
18- MainScreen : ExampleScreen ,
19+ MainScreen : {
20+ screen : ExampleScreen ,
21+ } ,
22+ DeepLinkingScreen : {
23+ screen : DeepLinkingScreen ,
24+ path : 'deeplink' ,
25+ } ,
1926 } ,
2027 {
2128 // By default the application will show the splash screen
Original file line number Diff line number Diff line change 1414 android : name =" .MainActivity"
1515 android : label =" @string/app_name"
1616 android : configChanges =" keyboard|keyboardHidden|orientation|screenSize"
17- android : windowSoftInputMode =" adjustResize" >
17+ android : windowSoftInputMode =" adjustResize"
18+ android : launchMode =" singleTask" >
1819 <intent-filter >
1920 <action android : name =" android.intent.action.MAIN" />
2021 <category android : name =" android.intent.category.LAUNCHER" />
2122 </intent-filter >
23+ <intent-filter >
24+ <action android : name =" android.intent.action.VIEW" />
25+ <category android : name =" android.intent.category.DEFAULT" />
26+ <category android : name =" android.intent.category.BROWSABLE" />
27+ <data android : scheme =" boilerplate" />
28+ </intent-filter >
2229 </activity >
2330 <activity android : name =" com.facebook.react.devsupport.DevSettingsActivity" />
2431 </application >
Original file line number Diff line number Diff line change 55 * LICENSE file in the root directory of this source tree.
66 */
77
8+ #import < React/RCTLinkingManager.h>
9+
810#import " AppDelegate.h"
911
1012#import < React/RCTBridge.h>
@@ -39,4 +41,10 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
3941#endif
4042}
4143
44+ - (BOOL )application : (UIApplication *)app openURL : (NSURL *)url
45+ options : (NSDictionary <UIApplicationOpenURLOptionsKey,id> *)options
46+ {
47+ return [RCTLinkingManager application: app openURL: url options: options];
48+ }
49+
4250@end
Original file line number Diff line number Diff line change 2020 <string >1.0 </string >
2121 <key >CFBundleSignature </key >
2222 <string >???? </string >
23+ <key >CFBundleURLTypes </key >
24+ <array >
25+ <dict >
26+ <key >CFBundleTypeRole </key >
27+ <string >Editor </string >
28+ <key >CFBundleURLName </key >
29+ <string >boilerplate </string >
30+ <key >CFBundleURLSchemes </key >
31+ <array >
32+ <string >boilerplate </string >
33+ </array >
34+ </dict >
35+ </array >
2336 <key >CFBundleVersion </key >
2437 <string >1 </string >
2538 <key >LSRequiresIPhoneOS </key >
2639 <true />
27- <key >NSAppTransportSecurity </key >
40+ <key >NSAppTransportSecurity </key >
2841 <dict >
2942 <key >NSAllowsArbitraryLoads </key >
3043 <true />
Original file line number Diff line number Diff line change @@ -345,6 +345,6 @@ SPEC CHECKSUMS:
345345 RNScreens: cf198f915f8a2bf163de94ca9f5bfc8d326c3706
346346 Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
347347
348- PODFILE CHECKSUM: 1aeb3204d81fb1938d1f1a04d0a3797595914ef3
348+ PODFILE CHECKSUM: 3d811d26fadf74812df3c538c7abf505a9be9900
349349
350- COCOAPODS: 1.9.0
350+ COCOAPODS: 1.9.3
You can’t perform that action at this time.
0 commit comments