Start a new topic

AR not fullscreen on iPhone X | Ionic app

Hello there, I'm having a bit of an issue with the latest iPhone. The HTML doesn't seem to cover the whole screen in portrait mode.
Some stackoverflow posts suggest that this is due to a certian WebView setting in the native iOS code?
I'd like some help with this..
I'm using the Wikitude PhoneGap plugin (7.2.1) together with Ionic. I have attached my markup and a screenshot of what happens.
Here is my enviorment info:

@ionic/app-scripts : 3.1.2

    Cordova Platforms : android 6.3.0 ios 4.5.4

    Ionic Framework : ionic-angular 3.9.2


System:


    ios-deploy : 1.9.2 

    Node : v8.9.1

    npm : 5.5.1 

    OS : macOS Sierra

    Xcode : Xcode 9.2 Build version 9C40b 



Thanks in advance,

html
(3.58 KB)

3 people have this problem

I would like to add that the app seems to be working fine when in landscape orientation, as well that I have configured the splash screen etc correctly since the Ionic part of the app covers the whole screen.

Since there are no replies yet, I've dug into the code a bit and found that indeed, when the iOS view stack is inspected, one can see that the now abandoned UIWebView that is used here has those scroll view content insets.
Is there a way for me to access the WebView if I have a reference to the WTArchitectView?
I guess the property isn't public since I wasn't able to find it, so could I atleast get a version of the SDK that allows me to interefere with the UIWebView?
Many thanks.

Good morning,



I'm afraid the UIWebView is an internal of the Wikitude SDK library and we do not expose any settings of it publicly. To complicate matters, we do not have an iPhone X available yet for testing. So I can't promise that this issue will be addressed immediately. My apologies for the inconvenience, but I believe there is nothing you can do to fix this for now; it requires internal fixing.



- Daniel

Well it's rather dissapointing that there's no support for the iPhone X yet.
In the meantime I have figured out a way to access the UIWebView and fix the issue, for anyone else experiencing this.
It's a hacky solution, but it works, unfortunately only in iOS 11. Since iPhone X is the only device affected, iOS version shouldn't be anything below 11 anyway.
I added this a #define to check for iOS 11, and modified the viewDidLoad function of the WTARViewController.
Add this to the your WTARViewController.m file:

 

#define IS_IOS11orHIGHER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0)

 


And the following code in your viewDidLoad function (preferably at the end).

    if (IS_IOS11orHIGHER) {
    for (UIView *subView in [self.architectView subviews]) {
        if ([subView isKindOfClass:[UIWebView class]]) {
            NSLog(@"%@", @"Found a webview!");
            UIWebView *uiWebView = (UIWebView *)subView;
            uiWebView.scrollView.contentInsetAdjustmentBehavior=UIScrollViewContentInsetAdjustmentNever;
        }
    }
      }

 Hope this helps others around here while we wait for an update.






3 people like this

"n n" solution tested and working!

Please, can you launch a new version of the cordova plugin with this improvement?

Thanks.

Is there any official solution from Wikitude Support for this issue?...


"I'm afraid the UIWebView is an internal of the Wikitude SDK library and we do not expose any settings of it publicly. To complicate matters, we do not have an iPhone X available yet for testing. So I can't promise that this issue will be addressed immediately. My apologies for the inconvenience, but I believe there is nothing you can do to fix this for now; it requires internal fixing".

Hi.


Is there any update on iPhoneX support release?

We're currently using the latest 7.2.0 version.



Thanks in advance!

Hi there,


The same as the last question:

Is there any update on iPhoneX support release?

We're currently using the latest 7.2.0 version.


Thanks in advance!


N.

Hi.


Is there any update on this issue ? iPhone X was released around a year ago and looks like that this bug is still present in v8.1.0.


Thanks in advance!


1 person likes this
Login or Signup to post a comment