@@ -89,9 +89,6 @@ - (NSString *)addTagsToHTML:(NSString *)html {
8989
9090- (void )loadedHtmlContent : (NSString *)html withBaseURL : (NSURL *)url {
9191 // UI Update must be done on the main thread
92- NSLog (@" 11111 [self.webView loadHTMLString:html baseURL:url];" );
93-
94- NSLog (@" 222222 [self.webView loadHTMLString:html baseURL:url];" );
9592 NSString *taggedHTML = [self addTagsToHTML: html];
9693 [OneSignal onesignal_Log: ONE_S_LL_VERBOSE message: [NSString stringWithFormat: @" loadedHtmlContent with Tags: \n %@ " , taggedHTML]];
9794 [self .webView loadHTMLString: taggedHTML baseURL: url];
@@ -120,8 +117,12 @@ - (void)setupWebviewWithMessageHandler:(id<WKScriptMessageHandler>)handler {
120117
121118- (void )setIsFullscreen : (BOOL )isFullscreen {
122119 _isFullscreen = isFullscreen;
120+ [self setWebviewFrame ];
121+ }
122+
123+ - (void )setWebviewFrame {
123124 CGRect mainBounds = UIScreen.mainScreen .bounds ;
124- if (!isFullscreen) {
125+ if (!self. isFullscreen ) {
125126 CGFloat marginSpacing = [OneSignalViewHelper sizeToScale: MESSAGE_MARGIN];
126127 mainBounds.size .width -= (2.0 * marginSpacing);
127128 }
@@ -137,13 +138,7 @@ - (void)resetWebViewToMaxBoundsAndResizeHeight:(void (^) (NSNumber *newHeight))
137138 [self .webView removeConstraints: [self .webView constraints ]];
138139
139140
140- CGRect mainBounds = UIScreen.mainScreen .bounds ;
141- if (!self.isFullscreen ) {
142- CGFloat marginSpacing = [OneSignalViewHelper sizeToScale: MESSAGE_MARGIN];
143- mainBounds.size .width -= (2.0 * marginSpacing);
144- }
145-
146- [self .webView setFrame: mainBounds];
141+ [self setWebviewFrame ];
147142 [self .webView layoutIfNeeded ];
148143
149144 // Evaluate JS getPageMetaData() method to obtain the updated height for the messageView to contain the webView contents
0 commit comments