File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
OneSignalInAppMessages/UI Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 140140// Info.plist key
141141#define FALLBACK_TO_SETTINGS_MESSAGE @" Onesignal_settings_fallback_message"
142142#define ONESIGNAL_SUPRESS_LAUNCH_URLS @" OneSignal_suppress_launch_urls"
143+ #define ONESIGNAL_IN_APP_HIDE_DROP_SHADOW @" OneSignal_in_app_message_hide_drop_shadow"
143144
144145// GDPR Privacy Consent
145146#define GDPR_CONSENT_GRANTED @" GDPR_CONSENT_GRANTED"
Original file line number Diff line number Diff line change @@ -195,6 +195,19 @@ - (void)setupInitialMessageUI {
195195 }];
196196}
197197
198+ - (void )updateDropShadow {
199+ // the plist value specifies whether the user wants to add drop shadow to the In App Message
200+ NSDictionary *bundleDict = [[NSBundle mainBundle ] infoDictionary ];
201+ BOOL hideDropShadow = [bundleDict[ONESIGNAL_IN_APP_HIDE_DROP_SHADOW] boolValue ];
202+ if (hideDropShadow) {
203+ return ;
204+ }
205+ self.messageView .layer .shadowOffset = CGSizeMake (0 , 3 );
206+ self.messageView .layer .shadowColor = [[UIColor blackColor ] CGColor ];
207+ self.messageView .layer .shadowRadius = 3 .0f ;
208+ self.messageView .layer .shadowOpacity = 0 .55f ;
209+ }
210+
198211- (void )displayMessage {
199212 [OneSignalLog onesignalLog: ONE_S_LL_VERBOSE message: @" Displaying In-App Message" ];
200213
@@ -233,9 +246,11 @@ - (OSResultSuccessBlock)messageContentOnSuccess {
233246 if (self.waitForTags ) {
234247 return ;
235248 }
249+ [self updateDropShadow ];
236250 [self .delegate messageWillDisplay: self .message];
237251 [self .messageView loadedHtmlContent: self .pendingHTMLContent withBaseURL: baseUrl];
238252 self.pendingHTMLContent = nil ;
253+
239254 }];
240255 };
241256}
You can’t perform that action at this time.
0 commit comments