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 @@ -200,6 +200,19 @@ - (void)setupInitialMessageUI {
200200 }];
201201}
202202
203+ - (void )updateDropShadow {
204+ // the plist value specifies whether the user wants to add drop shadow to the In App Message
205+ NSDictionary *bundleDict = [[NSBundle mainBundle ] infoDictionary ];
206+ BOOL hideDropShadow = [bundleDict[ONESIGNAL_IN_APP_HIDE_DROP_SHADOW] boolValue ];
207+ if (hideDropShadow) {
208+ return ;
209+ }
210+ self.messageView .layer .shadowOffset = CGSizeMake (0 , 3 );
211+ self.messageView .layer .shadowColor = [[UIColor blackColor ] CGColor ];
212+ self.messageView .layer .shadowRadius = 3 .0f ;
213+ self.messageView .layer .shadowOpacity = 0 .55f ;
214+ }
215+
203216- (void )displayMessage {
204217 [OneSignalLog onesignalLog: ONE_S_LL_VERBOSE message: @" Displaying In-App Message" ];
205218
@@ -238,9 +251,11 @@ - (OSResultSuccessBlock)messageContentOnSuccess {
238251 if (self.waitForTags ) {
239252 return ;
240253 }
254+ [self updateDropShadow ];
241255 [self .delegate messageWillDisplay: self .message];
242256 [self .messageView loadedHtmlContent: self .pendingHTMLContent withBaseURL: baseUrl];
243257 self.pendingHTMLContent = nil ;
258+
244259 }];
245260 };
246261}
You can’t perform that action at this time.
0 commit comments