diff --git a/BlueShift-iOS-SDK/BlueShift.m b/BlueShift-iOS-SDK/BlueShift.m index bcc152db..58785892 100644 --- a/BlueShift-iOS-SDK/BlueShift.m +++ b/BlueShift-iOS-SDK/BlueShift.m @@ -173,16 +173,16 @@ - (NSString *) getDeviceToken { } - (void) createInAppNotification:(NSDictionary *)dictionary forApplicationState:(UIApplicationState)applicationState { - if (_config.enableInAppNotification == YES && [[UIApplication sharedApplication] applicationState] == UIApplicationStateActive) { + if (_config.enableInAppNotification == YES) { if ([BlueshiftEventAnalyticsHelper isSilentPushNotification: dictionary] && _config.inAppBackgroundFetchEnabled == YES) { [self fetchInAppNotificationFromAPI:^() { - if (self->_config.inAppManualTriggerEnabled == NO) { + if (self->_config.inAppManualTriggerEnabled == NO && [[UIApplication sharedApplication] applicationState] == UIApplicationStateActive) { [_inAppNotificationMananger fetchInAppNotificationsFromDataStore: BlueShiftInAppTriggerNow]; } } failure:^(NSError *error){ NSLog(@"%@", error); }]; - } else if(_config.inAppManualTriggerEnabled == NO){ + } else if(_config.inAppManualTriggerEnabled == NO && [[UIApplication sharedApplication] applicationState] == UIApplicationStateActive){ [self startInAppMessageLoadFromaDBTimer]; } } diff --git a/BlueShift-iOS-SDK/BlueShiftAppData.m b/BlueShift-iOS-SDK/BlueShiftAppData.m index b6a35b21..35949835 100644 --- a/BlueShift-iOS-SDK/BlueShiftAppData.m +++ b/BlueShift-iOS-SDK/BlueShiftAppData.m @@ -39,7 +39,7 @@ - (NSString *)bundleIdentifier { - (NSDictionary *)toDictionary { NSMutableDictionary *appMutableDictionary = [NSMutableDictionary dictionary]; if (self.appName) { - [appMutableDictionary setObject:self.appName forKey:@"app_name"]; + [appMutableDictionary setObject:self.bundleIdentifier forKey:@"app_name"]; } if (self.appVersion) {