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
9 changes: 9 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
analyzer:
exclude:
- build/**
- android/**
- ios/**
- web/**
- windows/**
- macos/**
- linux/**
include: package:very_good_analysis/analysis_options.yaml
30 changes: 15 additions & 15 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.4.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -111,33 +111,33 @@ packages:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
url: "https://pub.dev"
source: hosted
version: "0.12.17"
version: "0.12.20"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
url: "https://pub.dev"
source: hosted
version: "0.11.1"
version: "0.13.0"
meta:
dependency: transitive
description:
name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.19.0"
open_settings_plus:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "0.4.2"
version: "0.5.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -203,18 +203,18 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
url: "https://pub.dev"
source: hosted
version: "0.7.7"
version: "0.7.12"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47
url: "https://pub.dev"
source: hosted
version: "2.2.0"
version: "2.4.2"
vm_service:
dependency: transitive
description:
Expand All @@ -224,5 +224,5 @@ packages:
source: hosted
version: "15.0.0"
sdks:
dart: ">=3.8.0-0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
dart: ">=3.11.0 <4.0.0"
flutter: ">=3.41.0"
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ public class OpenSettingsPlusPlugin: NSObject, FlutterPlugin {
let arguments = call.arguments as? [String: Any]
let argument = arguments?["settingToOpen"] as? String ?? ""

print("OpenSettingsPlusPlugin: \(argument)")

if let url = URL(string: argument) {
if UIApplication.shared.canOpenURL(url) {
if #available(iOS 10.0, *) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
UIApplication.shared.openURL(url)
}
if let url = URL(string: argument), UIApplication.shared.canOpenURL(url) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Declare the new scheme before querying it

For host apps that do not list settings-navigation in LSApplicationQueriesSchemes—including the repository's example app—iOS rejects this canOpenURL query, so execution returns false before open is attempted. Consequently, the newly added iOS 26 routes, including the five version-switched existing APIs, do not work with the default setup; either avoid this preflight check and use the open completion result or require and document the host Info.plist entry.

Useful? React with 👍 / 👎.

UIApplication.shared.open(url, options: [:]) { success in
result(success)
}
} else {
result(false)
}
} else if call.method == "getIOSVersion" {
let version = UIDevice.current.systemVersion
result(version)
} else {
result(false)
}
Expand Down
6 changes: 6 additions & 0 deletions lib/bridge/open_settings_plus_method_channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@ class MethodChannelOpenSettingsPlus extends OpenSettingsPlusPlatform {

return success ?? false;
}

@override
Future<String> getIOSVersion() async {
final version = await methodChannel.invokeMethod<String>('getIOSVersion');
return version ?? '0';
}
}
5 changes: 5 additions & 0 deletions lib/bridge/open_settings_plus_platform_interface.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ abstract class OpenSettingsPlusPlatform extends PlatformInterface {
/// This way we can pass any message to native side and handle it there.
/// Note: android and ios have different implementation.
Future<bool> sendMessageToNative(String message);

/// Returns the iOS version string (e.g. `"26.0"`).
///
/// On Android this returns `"0"`.
Future<String> getIOSVersion() => Future.value('0');
}
1 change: 1 addition & 0 deletions lib/core/open_settings_plus.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:open_settings_plus/bridge/open_settings_plus_platform_interface.dart';

Expand Down
Loading
Loading