Skip to content

Commit 4cc5ae7

Browse files
authored
Merge pull request #1493 from OneSignal/fix/deprecated_openurl
[3.x.x] Replace deprecated openURL method
2 parents cd6e9a9 + d2994ef commit 4cc5ae7

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
jobs:
1212
build:
1313
name: Build and Test using any available iPhone simulator
14-
runs-on: macos-latest
14+
runs-on: macos-latest-large
1515

1616
steps:
1717
- name: Checkout OneSignal-iOS-SDK

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)