diff --git a/iOS_SDK/Framework/OneSignal.framework/Versions/A/OneSignal b/iOS_SDK/Framework/OneSignal.framework/Versions/A/OneSignal index f3ad67c5c..16dae1373 100644 Binary files a/iOS_SDK/Framework/OneSignal.framework/Versions/A/OneSignal and b/iOS_SDK/Framework/OneSignal.framework/Versions/A/OneSignal differ diff --git a/iOS_SDK/OneSignal/OneSignal.m b/iOS_SDK/OneSignal/OneSignal.m index e8fa9ef62..eb4e3baee 100755 --- a/iOS_SDK/OneSignal/OneSignal.m +++ b/iOS_SDK/OneSignal/OneSignal.m @@ -75,7 +75,7 @@ @implementation OneSignal -NSString* const ONESIGNAL_VERSION = @"020114"; +NSString* const ONESIGNAL_VERSION = @"020115"; static NSString* mSDKType = @"native"; static BOOL coldStartFromTapOnNotification = NO; static BOOL registeredWithApple = NO; //Has attempted to register for push notifications with Apple. @@ -794,7 +794,8 @@ + (void)notificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isActive { [[NSUserDefaults standardUserDefaults] synchronize]; } - inAppAlert = [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue] == OSNotificationDisplayTypeInAppAlert; + int iaaoption = [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue]; + inAppAlert = iaaoption == OSNotificationDisplayTypeInAppAlert; [OneSignalHelper lastMessageReceived:messageDict]; @@ -825,7 +826,7 @@ + (void)notificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isActive { return; } - //App is active and a notification was received without inApp display. Display type is none + //App is active and a notification was received without inApp display. Display type is none or notification //Call Received Block [OneSignalHelper handleNotificationReceived:[[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue]]; @@ -1142,7 +1143,8 @@ - (void)userNotificationCenter:(id)center didReceiveNotificationResponse:(id)res } else { - BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive; + BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive && + [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue] != OSNotificationDisplayTypeNotification; [OneSignal notificationOpened:usrInfo isActive:isActive]; [OneSignal tunnelToDelegate:center :response :completionHandler]; return; @@ -1173,7 +1175,9 @@ - (void)userNotificationCenter:(id)center didReceiveNotificationResponse:(id)res userInfo[@"aps"] = @{ @"alert" : userInfo[@"m"] }; } - BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive; + BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive && + [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue] != OSNotificationDisplayTypeNotification; + [OneSignal notificationOpened:userInfo isActive:isActive]; [OneSignal tunnelToDelegate:center :response :completionHandler];