Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[User Model] Add plist option to override gray overlay to In App Messages #1396

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
#define FALLBACK_TO_SETTINGS_MESSAGE @"Onesignal_settings_fallback_message"
#define ONESIGNAL_SUPRESS_LAUNCH_URLS @"OneSignal_suppress_launch_urls"
#define ONESIGNAL_IN_APP_HIDE_DROP_SHADOW @"OneSignal_in_app_message_hide_drop_shadow"
#define ONESIGNAL_IN_APP_HIDE_GRAY_OVERLAY @"OneSignal_in_app_message_hide_gray_overlay"

// GDPR Privacy Consent
#define GDPR_CONSENT_GRANTED @"GDPR_CONSENT_GRANTED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,17 @@ - (void)setupInitialMessageUI {
// Only the center modal and full screen (both centered) IAM should have a dark background
// So get the alpha based on the IAM being a banner or not
double alphaBackground = [self.message isBanner] ? 0.0 : 0.5;
[UIView animateWithDuration:0.3 animations:^{

// the plist value specifies whether the user wants to add a gray overlay to the In App Message
NSDictionary *bundleDict = [[NSBundle mainBundle] infoDictionary];
BOOL hideGrayOverlay = [bundleDict[ONESIGNAL_IN_APP_HIDE_GRAY_OVERLAY] boolValue];
if (hideGrayOverlay) {
self.view.backgroundColor = [UIColor clearColor];
} else {
self.view.backgroundColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:alphaBackground];
}

[UIView animateWithDuration:0.3 animations:^{
self.view.alpha = 1.0;
} completion:^(BOOL finished) {
if (!finished)
Expand Down
Loading