|
@@ -0,0 +1,26 @@
|
|
1
|
+package com.reactnativenavigation.controllers;
|
|
2
|
+
|
|
3
|
+import android.content.Intent;
|
|
4
|
+import android.net.Uri;
|
|
5
|
+
|
|
6
|
+import static android.content.Intent.ACTION_VIEW;
|
|
7
|
+
|
|
8
|
+public class Linking {
|
|
9
|
+ private static Uri initialUri;
|
|
10
|
+
|
|
11
|
+ static void saveInitialUri(Uri initialUri) {
|
|
12
|
+ Linking.initialUri = initialUri;
|
|
13
|
+ }
|
|
14
|
+
|
|
15
|
+ static void setInitialUri(Intent intent) {
|
|
16
|
+ if (initialUri != null) {
|
|
17
|
+ intent.setData(initialUri);
|
|
18
|
+ intent.setAction(ACTION_VIEW);
|
|
19
|
+ clear();
|
|
20
|
+ }
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ private static void clear() {
|
|
24
|
+ initialUri = null;
|
|
25
|
+ }
|
|
26
|
+}
|