Skip to content

Commit

Permalink
Merge pull request #1493 from OneSignal/fix/deprecated_openurl
Browse files Browse the repository at this point in the history
[3.x.x] Replace deprecated openURL method
  • Loading branch information
nan-li authored Oct 7, 2024
2 parents cd6e9a9 + d2994ef commit 4cc5ae7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
build:
name: Build and Test using any available iPhone simulator
runs-on: macos-latest
runs-on: macos-latest-large

steps:
- name: Checkout OneSignal-iOS-SDK
Expand Down
2 changes: 1 addition & 1 deletion iOS_SDK/OneSignalSDK/Source/OneSignalHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ + (void)displayWebView:(NSURL*)url {
[webVC showInApp];
} else {
// Keep dispatch_async. Without this the url can take an extra 2 to 10 secounds to open.
[[UIApplication sharedApplication] openURL:url];
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}
});
}];
Expand Down
5 changes: 1 addition & 4 deletions iOS_SDK/OneSignalSDK/Source/OneSignalLocation.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,7 @@ + (void)showLocationSettingsAlertController {
[[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) {
if (tappedActionIndex > -1) {
[OneSignal onesignalLog:ONE_S_LL_DEBUG message:@"CLLocationManage open settings option click"];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
#pragma clang diagnostic pop
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString] options:@{} completionHandler:nil];
}
[OneSignalLocation sendAndClearLocationListener:false];
return;
Expand Down

0 comments on commit 4cc5ae7

Please sign in to comment.