Skip to content

Commit 137add7

Browse files
author
Joseph Kalash
committed
- Crash Fix - This release fixes a crash on versions of our SDK 2.0.0 and newer on iOS 10 devices. This crash occurs when an iOS 10 user launches the app by tapping on a notification with a Launch URL, if you have set kOSSettingsKeyInAppAlerts to false (default is true). Please update to this SDK release or newer to resolve this issue.
- Fixed an issue where the notificationAction block would be called twice on iOS 10 devices when a user tapped on a notification.
1 parent fd228c4 commit 137add7

File tree

7 files changed

+22
-12
lines changed

7 files changed

+22
-12
lines changed

OneSignal.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "OneSignal"
3-
s.version = "2.0.10"
3+
s.version = "2.0.11"
44
s.summary = "OneSignal push notification library for mobile apps."
55
s.homepage = "https://onesignal.com"
66
s.license = { :type => 'MIT', :file => 'LICENSE' }

iOS_SDK/Framework/OneSignal.framework/Modules/module.modulemap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ framework module OneSignal {
22
umbrella header "OneSignal.h"
33
export *
44
module * { export * }
5-
}
5+
}
-19.3 KB
Binary file not shown.
-14.5 KB
Binary file not shown.

iOS_SDK/OneSignal/OneSignal.m

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
@implementation OneSignal
7373

74-
NSString* const ONESIGNAL_VERSION = @"020010";
74+
NSString* const ONESIGNAL_VERSION = @"020011";
7575

7676
static bool registeredWithApple = false; //Has attempted to register for push notifications with Apple.
7777
static OneSignalTrackIAP* trackIAPPurchase;
@@ -177,16 +177,22 @@ + (id)initWithLaunchOptions:(NSDictionary*)launchOptions appId:(NSString*)appId
177177

178178
[OneSignalTracker onFocus:NO];
179179
}
180+
181+
/*
182+
* No need to call the handleNotificationOpened:userInfo as it will be called from the
183+
* application:didReceiveRemoteNotification:fetchCompletionHandler / userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler (i10)
184+
*/
180185

181186
//If app opened from tap on notification or action
187+
/*
182188
NSDictionary* userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
183189
if(userInfo) {
184190
OSNotificationActionType type = Opened;
185191
if(userInfo[@"custom"][@"a"][@"actionSelected"] || userInfo[@"actionSelected"])
186192
type = ActionTaken;
187193
[self handleNotificationOpened:userInfo isActive:NO actionType:type displayType:Notification];
188194
}
189-
195+
*/
190196
[self clearBadgeCount:false];
191197

192198
if ([OneSignalTrackIAP canTrack])
@@ -785,7 +791,7 @@ + (void)notificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isActive {
785791
}
786792
else {
787793

788-
//app was in background and opened due to a tap on a notification or an action check what type
794+
//app was in background / not running and opened due to a tap on a notification or an action check what type
789795
NSString* actionSelected = NULL;
790796
OSNotificationActionType type = Opened;
791797
if(messageDict[@"custom"][@"a"][@"actionSelected"]) {
@@ -835,12 +841,11 @@ + (void) handleNotificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isAc
835841
+ (void)launchWebURL:(NSString*)openUrl {
836842

837843
if (openUrl) {
838-
if ([OneSignalHelper verifyURL:openUrl])
844+
if ([OneSignalHelper verifyURL:openUrl]) {
839845
//Create a dleay to allow alertview to dismiss before showing anything or going to safari
840-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
841-
NSURL *url = [NSURL URLWithString:openUrl];
842-
[OneSignalHelper displayWebView:url];
843-
});
846+
NSURL *url = [NSURL URLWithString:openUrl];
847+
[OneSignalHelper performSelector:@selector(displayWebView:) withObject:url afterDelay:0.5];
848+
}
844849
}
845850

846851
}

iOS_SDK/OneSignalMobileProvision/OneSignalMobileProvision.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
@implementation OneSignalMobileProvision
1414

15-
/** embedded.mobileprovision plist format:
16-
15+
/**
16+
embedded.mobileprovision plist format:
1717
AppIDName, // string - TextDetective
1818
ApplicationIdentifierPrefix[], // [ string - 66PK3K3KEV ]
1919
CreationData, // date - 2013-01-17T14:18:05Z

iOS_SDK/OneSignalWebView.m

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ -(void)showInApp {
101101
if(!viewControllerForPresentation.view.superview)
102102
[mainWindow addSubview:[viewControllerForPresentation view]];
103103

104+
@try {
104105
[viewControllerForPresentation presentViewController:navController animated:YES completion:NULL];
106+
}
107+
@catch(NSException* exception) {
108+
NSLog(@"%@", exception);
109+
}
105110
}
106111

107112

0 commit comments

Comments
 (0)