0

I would like to know how you can open the app settings page on both ios and android.

1 Answer 1

1

Change org.nativescript.app with your app's package id.

import { Application, isAndroid } from '@nativescript/core';

const openAppSetting = async () => {
  if(isAndroid) {
    var activity = Application.android.foregroundActivity || Application.android.startActivity

    activity.startActivity(new android.content.Intent(
      android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
      android.net.Uri.fromParts("package", "org.nativescript.app", '')
    ))
  } else {
    UIApplication.sharedApplication.openURL(NSURL.URLWithString(UIApplicationOpenSettingsURLString));
  }
}

export {
  openAppSetting
}

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.