Skip to content

Commit 9388dfe

Browse files
committed
[maintenance] replace deprecated openURL method
* openURL: is completely deprecated on ios 18, so replace with the updated openURL:options:completionHandler:
1 parent cd6e9a9 commit 9388dfe

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ + (void)displayWebView:(NSURL*)url {
544544
[webVC showInApp];
545545
} else {
546546
// Keep dispatch_async. Without this the url can take an extra 2 to 10 secounds to open.
547-
[[UIApplication sharedApplication] openURL:url];
547+
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
548548
}
549549
});
550550
}];

iOS_SDK/OneSignalSDK/Source/OneSignalLocation.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,10 +293,7 @@ + (void)showLocationSettingsAlertController {
293293
[[OneSignalDialogController sharedInstance] presentDialogWithTitle:@"Location Not Available" withMessage:@"You have previously denied sharing your device location. Please go to settings to enable." withActions:@[@"Open Settings"] cancelTitle:@"Cancel" withActionCompletion:^(int tappedActionIndex) {
294294
if (tappedActionIndex > -1) {
295295
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:@"CLLocationManage open settings option click"];
296-
#pragma clang diagnostic push
297-
#pragma clang diagnostic ignored "-Wdeprecated"
298-
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
299-
#pragma clang diagnostic pop
296+
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
300297
}
301298
[OneSignalLocation sendAndClearLocationListener:false];
302299
return;

0 commit comments

Comments
 (0)