Browse Source

Add possibility to pass payload through handleDeepLink (#1128)

Add payload param to handleDeepLink
Edouard Eynard 7 years ago
parent
commit
62a56d98c7
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/Navigation.js

+ 6
- 2
src/Navigation.js View File

@@ -148,10 +148,14 @@ function clearEventHandler(navigatorEventID) {
148 148
 }
149 149
 
150 150
 function handleDeepLink(params = {}) {
151
-  if (!params.link) return;
151
+  const { link, payload } = params;
152
+
153
+  if (!link) return;
154
+
152 155
   const event = {
153 156
     type: 'DeepLink',
154
-    link: params.link
157
+    link,
158
+    ...(payload ? { payload } : {})
155 159
   };
156 160
   for (let i in _allNavigatorEventHandlers) {
157 161
     _allNavigatorEventHandlers[i](event);