Skip to content

Update README with iOS Simulator notes#78

Open
f3ndot wants to merge 2 commits intoRaphaelWoude:mainfrom
f3ndot:patch-1
Open

Update README with iOS Simulator notes#78
f3ndot wants to merge 2 commits intoRaphaelWoude:mainfrom
f3ndot:patch-1

Conversation

@f3ndot
Copy link
Copy Markdown

@f3ndot f3ndot commented Nov 24, 2025

Added caveat note about iOS Simulator behaviour regarding Settings app. Found via #73 (comment)

And potentially these open issues are referring to the same issue (assuming they're using a Simulator during development): #76 #77

Added caveat note about iOS Simulator behaviour regarding Settings app.
@rodri-zordan
Copy link
Copy Markdown

@f3ndot #76 The issue occurs on real devices running the new iOS 26

@RaphaelWoude
Copy link
Copy Markdown
Owner

Hi, sorry for the wait. I will be looking at this PR in the next couple days.

@RaphaelWoude
Copy link
Copy Markdown
Owner

I think that we can probably do a bit better with the text here. Something like

/**
 * Note that the only supported option by Apple is "App".
 * Using other options might break in future iOS versions,
 * get your app rejected from the App Store or behave
 * inconsistently (for example, the iOS Simulator may only
 * open the Settings app instead of the specified option).
 */

@fabiomartino
Copy link
Copy Markdown
Contributor

I suggest updating the Example section in README.md to reflect the new error handling strategy (State-based instead of Promise rejection) and to explicitly warn about iOS limitations.

Here is the proposed block:

import { NativeSettings, AndroidSettings, IOSSettings } from 'capacitor-native-settings';

/**
 * ⚠️ iOS Limitations
 *
 * 1. App Store Compliance: Apple officially supports opening only the app-specific
 * settings screen (IOSSettings.App). Other options rely on undocumented
 * URL schemes and risk App Store rejection.
 *
 * 2. Simulator Behavior: The iOS Simulator sometimes fails to open specific screens
 * (even the officially supported ones) and opens the main Settings app instead.
 * Please always test on a real device.
 */

// Example 1: Open with cross-platform handling
const result = await NativeSettings.open({
  optionAndroid: AndroidSettings.ApplicationDetails,
  optionIOS: IOSSettings.App,
});

if (!result.success) {
  // Handle error (Capacitor 8 state-based error handling)
  console.error(result.error);
}

// Example 2: Android specific
const androidResult = await NativeSettings.openAndroid({
  option: AndroidSettings.ApplicationDetails,
});

if (!androidResult.success) {
  console.error(androidResult.error);
}

// Example 3: iOS specific
const iosResult = await NativeSettings.openIOS({
  option: IOSSettings.App,
});

if (!iosResult.success) {
  console.error(iosResult.error);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants