Skip to content

Commit f559d43

Browse files
committed
Add override for IAM gray overlay
1 parent c4f645c commit f559d43

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignalCore/Source/OneSignalCommonDefines.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
#define FALLBACK_TO_SETTINGS_MESSAGE @"Onesignal_settings_fallback_message"
142142
#define ONESIGNAL_SUPRESS_LAUNCH_URLS @"OneSignal_suppress_launch_urls"
143143
#define ONESIGNAL_IN_APP_HIDE_DROP_SHADOW @"OneSignal_in_app_message_hide_drop_shadow"
144+
#define ONESIGNAL_IN_APP_HIDE_GRAY_OVERLAY @"OneSignal_in_app_message_hide_gray_overlay"
144145

145146
// GDPR Privacy Consent
146147
#define GDPR_CONSENT_GRANTED @"GDPR_CONSENT_GRANTED"

iOS_SDK/OneSignalSDK/OneSignalInAppMessages/UI/OSInAppMessageViewController.m

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,17 @@ - (void)setupInitialMessageUI {
184184
// Only the center modal and full screen (both centered) IAM should have a dark background
185185
// So get the alpha based on the IAM being a banner or not
186186
double alphaBackground = [self.message isBanner] ? 0.0 : 0.5;
187-
[UIView animateWithDuration:0.3 animations:^{
187+
188+
// the plist value specifies whether the user wants to add a gray overlay to the In App Message
189+
NSDictionary *bundleDict = [[NSBundle mainBundle] infoDictionary];
190+
BOOL hideGrayOverlay = [bundleDict[ONESIGNAL_IN_APP_HIDE_GRAY_OVERLAY] boolValue];
191+
if (hideGrayOverlay) {
192+
self.view.backgroundColor = [UIColor clearColor];
193+
} else {
188194
self.view.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:alphaBackground];
195+
}
196+
197+
[UIView animateWithDuration:0.3 animations:^{
189198
self.view.alpha = 1.0;
190199
} completion:^(BOOL finished) {
191200
if (!finished)

0 commit comments

Comments
 (0)