react-native-send-intent icon indicating copy to clipboard operation
react-native-send-intent copied to clipboard

feat(add-open-settings-uri-context)

Open FrederickEngelhardt opened this issue 2 years ago • 4 comments

  • support passing uri into the openSettings so menus such as file manager permissions can open with the settings intent
  • add uri option parameter to all sections of the app.
  • default uri to null if not provided by the API and pass the null value to the native side.

Questions:

  • Is there a way to test these changes? I'm not able to build the gradle project.
  • Can we add documentation for how to build this repo?

Edit:

  • I tested this in my own repo doing install like so "react-native-send-intent": "git+https://github.com/FrederickEngelhardt/react-native-send-intent/#feat/add-open-settings-uri-context". FYI with this method cache is nasty. Run this if you need to make updates yarn cache clean react-native-send-intent. Symlinks can also work but they require metro workarounds.

I tested this and links work well. So I think this feature is stable. Without the URI nothing will navigate but that's fine.

Example code

    const uri = `package:<package.name>` // must be your test app's package that requires this permission
    openSettings('android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION', uri)

FrederickEngelhardt avatar Mar 27 '23 05:03 FrederickEngelhardt

Hi @FrederickEngelhardt this looks pretty cool ;)

lucasferreira avatar Mar 27 '23 12:03 lucasferreira

Hi @FrederickEngelhardt this looks pretty cool ;)

lucasferreira avatar Mar 27 '23 12:03 lucasferreira

Hi @FrederickEngelhardt this looks pretty cool ;)

lucasferreira avatar Mar 27 '23 12:03 lucasferreira

@lucasferreira Just following up.

Does this change seem acceptable. If so, can we merge this PR?

FrederickEngelhardt avatar Jun 18 '23 08:06 FrederickEngelhardt