You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In iOS 18, Apple has made changes to the URL Opener API, which may require the use of UIApplication.shared in combination with openURL: inside @available(iOS 10.0, *). However, if your code uses the old [[UIApplication sharedApplication] openURL:] API, it is recommended to migrate to open(_:options:completionHandler:).
Library Change
Starting with iOS 18, the use of UIApplication.shared is still valid, but Apple recommends using open(_:options:completionHandler:) inside UIApplication. If you are having trouble, check that your code is in the correct context.
If you're using openURL: directly and without migrating to the new method, you may need to explicitly import UIKit in your file:
objective
Copy
Edit
#import <UIKit/UIKit.h>
Moving to openURL: Modern
Instead of:
objective
Copy
Edit
NSURL *url = [NSURL URLWithString:ns];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
if (!success) {
NSLog(@"Failed to open URL: %@", url);
}
}];
} else {
[[UIApplication sharedApplication] openURL:url];
}
Check if You Need to Import a New Library
In most cases, UIKit is still the primary library for handling URL opening. However, if you're using SwiftUI, you may need to handle URLs differently using @Environment(.openURL).
If your app uses SceneDelegate (iOS 13+), make sure your URL opening configuration is correctly implemented:
objective
Copy
Edit
(void)scene:(UIScene *)scene openURLContexts:(NSSet<UIOpenURLContext *> *)URLContexts;
If you're still having trouble, check Apple's latest documentation, as iOS 18 may have introduced additional security and privacy restrictions on opening external links.
Checking your source code I see that you are using the obsolete method
The text was updated successfully, but these errors were encountered:
Can you edit this issue to use English and include a screenshot that can be read.
Please include the device error log you can get from the settings app.
In iOS 18, Apple has made changes to the URL Opener API, which may require the use of UIApplication.shared in combination with openURL: inside @available(iOS 10.0, *). However, if your code uses the old [[UIApplication sharedApplication] openURL:] API, it is recommended to migrate to open(_:options:completionHandler:).
Library Change
Starting with iOS 18, the use of UIApplication.shared is still valid, but Apple recommends using open(_:options:completionHandler:) inside UIApplication. If you are having trouble, check that your code is in the correct context.
If you're using openURL: directly and without migrating to the new method, you may need to explicitly import UIKit in your file:
objective
Copy
Edit
#import <UIKit/UIKit.h>
Moving to openURL: Modern
Instead of:
objective
Copy
Edit
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:ns]];
Use:
objective
Copy
Edit
NSURL *url = [NSURL URLWithString:ns];
if (@available(iOS 10.0, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:^(BOOL success) {
if (!success) {
NSLog(@"Failed to open URL: %@", url);
}
}];
} else {
[[UIApplication sharedApplication] openURL:url];
}
Check if You Need to Import a New Library
In most cases, UIKit is still the primary library for handling URL opening. However, if you're using SwiftUI, you may need to handle URLs differently using @Environment(.openURL).
If your app uses SceneDelegate (iOS 13+), make sure your URL opening configuration is correctly implemented:
objective
Copy
Edit
If you're still having trouble, check Apple's latest documentation, as iOS 18 may have introduced additional security and privacy restrictions on opening external links.
Checking your source code I see that you are using the obsolete method

The text was updated successfully, but these errors were encountered: