jordanbyron / react-native-quick-actions

A react-native interface for Touch 3D home screen quick actions
MIT License
1.06k stars 93 forks source link

userInfo object only gives url other data are not there. #93

Open jdgalani opened 4 years ago

jdgalani commented 4 years ago

OS : MacOs Platform : android Device: Samsung Galaxy S9

I am setting Dynamic shorcuts with this code,

QuickActions.setShortcutItems([
  {
    type: "Orders", // Required
    title: "See your orders", // Optional, if empty, `type` will be used instead
    subtitle: "See orders you've made",
    icon: "Compose", // Icons instructions below
    userInfo: {
       url: "app://orders" ,// Provide any custom data like deep linking URL,
       screenType:"Data",
       screenData:"Data"
    }
  }
]);

but when I am getting data in popInitialAction it is having only url. while screenType and screenData are not there.

QuickActions.popInitialAction()
.then((data)=>{
   console.log(JSON.stringify(data))
})
.catch(console.error);

is there anything I can do for this? this is perfectly working for ios, issue is only on android.

ymc-thzi commented 4 years ago

Detected the same issue.

jordanbyron commented 4 years ago

Looks like that is correct. Check out this file from the source:

https://github.com/jordanbyron/react-native-quick-actions/blob/master/android/src/main/java/com/reactNativeQuickActions/UserInfo.java#L15

I didn't implement the android support and am not an android developer so it's not clear to me if this was an oversight or a limitation. I'm happy to review and accept PRs that add the functionality described above.

Sorry for the confusion. I'll throw something in the README to clear this up for now until support for that is added.

ymc-thzi commented 4 years ago

My current workaround is now to work only with the url param and add the parmas to that... like a common url with query params. In my popInitialAction/listener I have to parse it then.

jordanbyron commented 4 years ago

Related to #90