|
75 | 75 |
|
76 | 76 | @implementation OneSignal |
77 | 77 |
|
78 | | -NSString* const ONESIGNAL_VERSION = @"020114"; |
| 78 | +NSString* const ONESIGNAL_VERSION = @"020115"; |
79 | 79 | static NSString* mSDKType = @"native"; |
80 | 80 | static BOOL coldStartFromTapOnNotification = NO; |
81 | 81 | static BOOL registeredWithApple = NO; //Has attempted to register for push notifications with Apple. |
@@ -794,7 +794,8 @@ + (void)notificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isActive { |
794 | 794 | [[NSUserDefaults standardUserDefaults] synchronize]; |
795 | 795 | } |
796 | 796 |
|
797 | | - inAppAlert = [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue] == OSNotificationDisplayTypeInAppAlert; |
| 797 | + int iaaoption = [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue]; |
| 798 | + inAppAlert = iaaoption == OSNotificationDisplayTypeInAppAlert; |
798 | 799 |
|
799 | 800 | [OneSignalHelper lastMessageReceived:messageDict]; |
800 | 801 |
|
@@ -825,7 +826,7 @@ + (void)notificationOpened:(NSDictionary*)messageDict isActive:(BOOL)isActive { |
825 | 826 | return; |
826 | 827 | } |
827 | 828 |
|
828 | | - //App is active and a notification was received without inApp display. Display type is none |
| 829 | + //App is active and a notification was received without inApp display. Display type is none or notification |
829 | 830 | //Call Received Block |
830 | 831 | [OneSignalHelper handleNotificationReceived:[[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue]]; |
831 | 832 |
|
@@ -1142,7 +1143,8 @@ - (void)userNotificationCenter:(id)center didReceiveNotificationResponse:(id)res |
1142 | 1143 | } |
1143 | 1144 |
|
1144 | 1145 | else { |
1145 | | - BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive; |
| 1146 | + BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive && |
| 1147 | + [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue] != OSNotificationDisplayTypeNotification; |
1146 | 1148 | [OneSignal notificationOpened:usrInfo isActive:isActive]; |
1147 | 1149 | [OneSignal tunnelToDelegate:center :response :completionHandler]; |
1148 | 1150 | return; |
@@ -1173,7 +1175,9 @@ - (void)userNotificationCenter:(id)center didReceiveNotificationResponse:(id)res |
1173 | 1175 | userInfo[@"aps"] = @{ @"alert" : userInfo[@"m"] }; |
1174 | 1176 | } |
1175 | 1177 |
|
1176 | | - BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive; |
| 1178 | + BOOL isActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive && |
| 1179 | + [[[NSUserDefaults standardUserDefaults] objectForKey:@"ONESIGNAL_ALERT_OPTION"] intValue] != OSNotificationDisplayTypeNotification; |
| 1180 | + |
1177 | 1181 |
|
1178 | 1182 | [OneSignal notificationOpened:userInfo isActive:isActive]; |
1179 | 1183 | [OneSignal tunnelToDelegate:center :response :completionHandler]; |
|
0 commit comments