Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ Opens a specified settings screen when passed one of the constant values availab
SendIntentAndroid.openSettings("android.settings.SECURITY_SETTINGS");
```

Opening settings that require app package id uri

```javascript
SendIntentAndroid.openSettings("android.settings.MANAGE_APP_ALL_FILES_ACCESS_PERMISSION", "package:<your_app_package_id>);
```

## Example / Get voiceMail number

Please add this line to your AndroidManifest.xml file before using next example:
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
minSdkVersion _minSdkVersion
targetSdkVersion _targetSdkVersion
versionCode 28
versionName "1.3.0"
versionName "1.3.1"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to roll this back.

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,17 @@ public void shareImageToInstagram(String mineType, String mediaPath) {

}


@ReactMethod
public void openSettings(String screenName) {
Intent settingsIntent = new Intent(screenName);
public void openSettings(String screenName, String uriString) {
Intent settingsIntent;
if (uriString != null){
Uri uri = Uri.parse(uriString);
settingsIntent = new Intent(screenName, uri);
} else {
settingsIntent = new Intent(screenName);
}

settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

if (settingsIntent.resolveActivity(this.reactContext.getPackageManager()) != null) {
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ declare namespace SendIntentAndroid {
const openMapsWithRoute: (query: string, mode: string)=> void
const shareTextToLine: (options: TextToLineOptions)=> void
const shareImageToInstagram: (mimeType: string, mediaPath: string) => void
const openSettings: (settingsName: string) => void
const openSettings: (settingsName: string, uri?: string) => void
const getVoiceMailNumber: () => Promise<string>
const getPhoneNumber: () => Promise<string>
const gotoHomeScreen: () => void
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ var SendIntentAndroid = {
shareImageToInstagram(type, mediaPath) {
RNSendIntentAndroid.shareImageToInstagram(type, mediaPath);
},
openSettings(settingsName) {
RNSendIntentAndroid.openSettings(settingsName);
openSettings(settingsName, uri = null) {
RNSendIntentAndroid.openSettings(settingsName, uri);
},
getVoiceMailNumber() {
return RNSendIntentAndroid.getVoiceMailNumber();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-send-intent",
"version": "1.3.0",
"version": "1.3.1",
"description": "React Native Android module to use Android's Intent actions for send sms, text to shareable apps, open custom apps, make phone calls and etc",
"main": "index.js",
"types": "index.d.ts",
Expand Down