Skip to content
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 @@ -140,6 +140,7 @@
// Info.plist key
#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"

// GDPR Privacy Consent
#define GDPR_CONSENT_GRANTED @"GDPR_CONSENT_GRANTED"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,19 @@ - (void)setupInitialMessageUI {
}];
}

- (void)updateDropShadow {
// the plist value specifies whether the user wants to add drop shadow to the In App Message
NSDictionary *bundleDict = [[NSBundle mainBundle] infoDictionary];
BOOL hideDropShadow = [bundleDict[ONESIGNAL_IN_APP_HIDE_DROP_SHADOW] boolValue];
if (hideDropShadow) {
return;
}
self.messageView.layer.shadowOffset = CGSizeMake(0, 3);
self.messageView.layer.shadowColor = [[UIColor blackColor] CGColor];
self.messageView.layer.shadowRadius = 3.0f;
self.messageView.layer.shadowOpacity = 0.55f;
}

- (void)displayMessage {
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSE message:@"Displaying In-App Message"];

Expand Down Expand Up @@ -233,9 +246,11 @@ - (OSResultSuccessBlock)messageContentOnSuccess {
if (self.waitForTags) {
return;
}
[self updateDropShadow];
[self.delegate messageWillDisplay:self.message];
[self.messageView loadedHtmlContent:self.pendingHTMLContent withBaseURL:baseUrl];
self.pendingHTMLContent = nil;

}];
};
}
Expand Down