Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

userInfo & userInfo.url required for Android when calling setShortcutItems #90

Open
Rehubbard opened this issue Nov 13, 2019 · 1 comment
Labels

Comments

@Rehubbard
Copy link

On Android, the only way to get my Android build to work is to specify the userInfo property with a url field.

This works:

QuickActions.setShortcutItems([
      {
        type: "my_type",
        title: "Action title",
        icon: "my_icon",
        userInfo: {
           url: "" // for some reason this is required
        }
      },
])

But this crashes the app:

QuickActions.setShortcutItems([
      {
        type: "my_type",
        title: "Action title",
        icon: "my_icon"
      },
])

Is userInfo.url required on Android? If so, the readme could be updated to say that. I'm just curious and making sure i'm not doing anything wrong. Thanks for the awesome library!

@jordanbyron
Copy link
Owner

This looks like the code in question:

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

I'm assuming it's failing at the getString("url"); line. I couldn't tell you why it was written in a way that made it required, but it appears it may be, along with userInfo on Android. Unfortunately I did not write our android code so it's still primarily a black box to me. Would you mind taking a look and seeing if there is an easy way to make that attribute optional?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants