3

I want to open system settings in android. As per documentation, Linking.sendIntent() can send intents mentioned at AndroidSettings.

While using settingsIntent, i am facing issue.

How can i pass FLAG_ACTIVITY_NEW_TASK to sendIntent implementation?

Keshav Sharma
  • 124
  • 1
  • 9
  • 1
    I finally used [react-native-send-intent](https://www.npmjs.com/package/react-native-send-intent) for opening system setting. – Keshav Sharma Sep 17 '19 at 03:55

1 Answers1

4

There is no way to pass flags into sendIntent. I determined it by reading the source code. It's possible that they have been testing with an older device that allowed intents to be sent outside an activity (it's apparently an Android bug). There are no open bugs in the React Native repo to track these issues, which paired with some discussions on moving it into a community-maintained repo, probably means it'll be removed from core in the future.

As you have discovered already, you'll need to use a 3rd party library to send intents. react-native-send-intent, as you suggested, is a good option.

Seph Soliman
  • 300
  • 2
  • 6