Browse Source

deep-links payload on docs (#1152)

Carlos Roberto 7 years ago
parent
commit
4848cf6e50
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      docs/deep-links.md

+ 7
- 3
docs/deep-links.md View File

7
 ```js
7
 ```js
8
 onContactSelected(contactID) {
8
 onContactSelected(contactID) {
9
   this.props.navigator.handleDeepLink({
9
   this.props.navigator.handleDeepLink({
10
-    link: 'chats/' + contactID
10
+    link: 'chats/' + contactID,
11
+    payload: '' // (optional) Extra payload with deep link
11
   });
12
   });
12
 }
13
 }
13
 ```
14
 ```
28
   onNavigatorEvent(event) {
29
   onNavigatorEvent(event) {
29
     // handle a deep link
30
     // handle a deep link
30
     if (event.type == 'DeepLink') {
31
     if (event.type == 'DeepLink') {
31
-      const parts = event.link.split('/');
32
+
33
+      const parts = event.link.split('/'); // Link parts
34
+      const payload = event.payload;       // (optional) The payload
35
+
32
       if (parts[0] == 'tab2') {
36
       if (parts[0] == 'tab2') {
33
         // handle the link somehow, usually run a this.props.navigator command
37
         // handle the link somehow, usually run a this.props.navigator command
34
       }
38
       }
38
 
42
 
39
 #### Deep link string format
43
 #### Deep link string format
40
 
44
 
41
-There is no specification for the format of deep links. Since you're implementing the parsing logic in your handlers, you can use any format you wish.
45
+There is no specification for the format of deep links. Since you're implementing the parsing logic in your handlers, you can use any format you wish.