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'
7
7
import { useDispatch } from 'react-redux'
8
8
9
9
const RootScreen = ( ) => {
10
+ // Deep linking prefix
11
+ const prefix = 'boilerplate://' ;
12
+
10
13
const dispatch = useDispatch ( )
11
14
12
15
useEffect ( ( ) => {
@@ -20,6 +23,7 @@ const RootScreen = () => {
20
23
ref = { ( navigatorRef ) => {
21
24
NavigationService . setTopLevelNavigator ( navigatorRef )
22
25
} }
26
+ uriPrefix = { prefix }
23
27
/>
24
28
</ View >
25
29
)
Original file line number Diff line number Diff line change 1
1
import { createAppContainer , createStackNavigator } from 'react-navigation'
2
2
3
3
import ExampleScreen from 'App/Containers/Example/ExampleScreen'
4
+ import DeepLinkingScreen from 'App/Containers/DeepLinking/DeepLinkingScreen'
4
5
import SplashScreen from 'App/Containers/SplashScreen/SplashScreen'
5
6
6
7
/**
@@ -15,7 +16,13 @@ const StackNavigator = createStackNavigator(
15
16
SplashScreen : SplashScreen ,
16
17
// The main application screen is our "ExampleScreen". Feel free to replace it with your
17
18
// own screen and remove the example.
18
- MainScreen : ExampleScreen ,
19
+ MainScreen : {
20
+ screen : ExampleScreen ,
21
+ } ,
22
+ DeepLinkingScreen : {
23
+ screen : DeepLinkingScreen ,
24
+ path : 'deeplink' ,
25
+ } ,
19
26
} ,
20
27
{
21
28
// By default the application will show the splash screen
Original file line number Diff line number Diff line change 14
14
android : name =" .MainActivity"
15
15
android : label =" @string/app_name"
16
16
android : configChanges =" keyboard|keyboardHidden|orientation|screenSize"
17
- android : windowSoftInputMode =" adjustResize" >
17
+ android : windowSoftInputMode =" adjustResize"
18
+ android : launchMode =" singleTask" >
18
19
<intent-filter >
19
20
<action android : name =" android.intent.action.MAIN" />
20
21
<category android : name =" android.intent.category.LAUNCHER" />
21
22
</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 >
22
29
</activity >
23
30
<activity android : name =" com.facebook.react.devsupport.DevSettingsActivity" />
24
31
</application >
Original file line number Diff line number Diff line change 5
5
* LICENSE file in the root directory of this source tree.
6
6
*/
7
7
8
+ #import < React/RCTLinkingManager.h>
9
+
8
10
#import " AppDelegate.h"
9
11
10
12
#import < React/RCTBridge.h>
@@ -39,4 +41,10 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
39
41
#endif
40
42
}
41
43
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
+
42
50
@end
Original file line number Diff line number Diff line change 20
20
<string >1.0 </string >
21
21
<key >CFBundleSignature </key >
22
22
<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 >
23
36
<key >CFBundleVersion </key >
24
37
<string >1 </string >
25
38
<key >LSRequiresIPhoneOS </key >
26
39
<true />
27
- <key >NSAppTransportSecurity </key >
40
+ <key >NSAppTransportSecurity </key >
28
41
<dict >
29
42
<key >NSAllowsArbitraryLoads </key >
30
43
<true />
Original file line number Diff line number Diff line change @@ -345,6 +345,6 @@ SPEC CHECKSUMS:
345
345
RNScreens: cf198f915f8a2bf163de94ca9f5bfc8d326c3706
346
346
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
347
347
348
- PODFILE CHECKSUM: 1aeb3204d81fb1938d1f1a04d0a3797595914ef3
348
+ PODFILE CHECKSUM: 3d811d26fadf74812df3c538c7abf505a9be9900
349
349
350
- COCOAPODS: 1.9.0
350
+ COCOAPODS: 1.9.3
You can’t perform that action at this time.
0 commit comments