Start a new topic
Solved

New View Style (Not Full Screen) & Questions - iOS 13 / SDK 8.9.1

Hi,


I recently updated to Wikitude Cordova SDK 8.9.1 and using an iPhone 11 with iOS 13 installed.


The Wikitude world used to load full screen on previous iOS and SDK versions.


With the new SDK and iOS 13 the world opens up in a sort of InAppBrowser type of view that can be dismissed by swiping down. Also the app is visible behind it on the top.


Is this the standard way the Wikitude world view is now? As a result of switching to WKWebView? Is there any way to get the completely full screen view back? See attached images. One is how it looks loaded. One is me swiping down to close it.


Did anything in the Cordova/JavaScript API change from 8.5 to 8.9.1? As in, do I have to change anything in my code when update from 8.5 to 8.9.1 in order for it to work properly? I didn't see anything in the docs but wanted to make sure there weren't any changes I need to make on my end. Are there?


Thank you!

loaded.png
(4.59 MB)
png

Hi Eric,


Did you check the iOS migration guide already to make sure that general iOS related changes from 8.5 to 8.9.1 were applied?


https://www.wikitude.com/external/doc/documentation/latest/ios/migration.html#migration-notes


If not please check and let us know if the error persist afterwards.


Thx and greetings

Nicola

Hi,


Thank you for the reply. I have viewed the change log.


I do not know if it is an error. I am asking if this view that I mentioned and attached pictures of is how it is supposed to look now.


Is it an error? Or is that how the view is now supposed to look and behave using the specs I mentioned? Also, if this is how it looks now and it is not an error: "is there any way to get the completely full screen view back?"


Please advise if this an error or how it is supposed to look now?


Thanks.

Hi Eric,


The iOS 13 release changed the default style of view controller presentation.


We addressed this in our 8.9 release, setting the presentation style of our controller to full screen in order to keep the same behaviour as before. The iOS source of the plugin you downloaded should contain this line:

self.arViewController.modalPresentationStyle = UIModalPresentationFullScreen;


Please make sure that the plugin you have imported in your project also contains this, or you may still be using an older release.


Otherwise, can you also reproduce your issue in our sample app?



- Damian


1 person likes this

Thank you for the reply.


I will check to see if that line is in the package I downloaded. I believe I am on the latest version of Wikitude considering I added to the project it 6 days ago but there may be some persistence somewhere with an old version. I will double check.


Is there any way to set this from my JavaScript that launches the world? Or is it only in the iOS src file that it is allowed?


I will let you know tonight 1) If what I have downloaded has that line in the src/iOS and 2) If it does and does not work then if I have the same issue on your sample app.

Hi,


Thank you for your support on this. I had the right version downloaded, but an older version was persisting in my platform. I removed the platform the added it back, and this solved my issue.


Now I am seeing a "License Expired" overlay. I sent an email to support and sales inquiring about it. I ordered a startup license on 6/17/2019 and I am trying to upgrade my app to work on iOS13.


Thank you,

Eric

I remarked this as unsolved because I am back using SDK 8.7 and have a few questions regarding full screen capabilities using SDK 8.7, building on XCode 11, and running on iOS13. 


As before, building for iOS 13, using XCode 11 and SDK 8.7 works, but the view is a page sheet so I have some questions based on that:


  • Is there any way to make this full screen other than upgrading to version 8.9.1?

Is there a workaround for those of us on older SDKs (8.7 and below) and building for iOS13 to allow us to have full screen without any adverse effects on object placement? Meaning all the objects align as they should in full screen? Anything you know of to change, that we are allowed/able to change, that can get us full screen in this circumstance. It is not an error, but anyone building on the new XCode 11 with any SDK under 8.9 will be having the issue of page sheet default and misaligned objects if full screen, unless I'm missing something. Any hints or leads on where to look if not a solution?


  • Is there a method to detect when a user swipes down to close the world if page sheet cannot be avoided? Or is there a method to disable that swipe down to close action?
Looking for some way to either disable it or ideally how we detect when the world is swipe closed (or is it swipe hidden?) in this way. Again, I'm sure a lot of people on older SDKs will be experiencing this when they build updates.


Has anyone found a solution? Is there one? Full screen looks so much better than page sheet for these AR experiences.


Thank you,

Eric

Hi,


As I mentioned, the iOS 13 release changed the default presentation style. Since we did not specify a style in our plugin before, releases prior to 8.9 running on iOS 13 devices will default to the modal presentation.


All that is needed to fix this is to specify this style for the UIViewController in the native side. Feel free to modify the "open" method in the WTWikitudePlugin.m file in the 8.7 version you are using, adding the following line as we do in our 8.9 release:

self.arViewController.modalPresentationStyle = UIModalPresentationFullScreen;



- Damian

Thank you for the quick reply. I understand but there is an adverse effect when only that line is added.


I tried adding that line to the file you mentioned but it causes the touch areas (on select areas of the markers) to be below the marker itself. So the screen is full, but to activate a marker I have to tap below the actual marker. The touch point and the image are not aligned.


This is why I was wondering if any other styles or viewport info needed to be added anywhere to remedy this.


Does this description make sense? Tried my best to explain it.

To try to put it in more accurate terms:


When I add that line to my plugin, the view becomes full screen, but the onClick of the ImageDrawable is below the ImageDrawable by what I would guess is about 10-15px on an iPhone.


Do you have any idea why this would happen? Or how to fix it? Have you experienced this before?

I think it is because I need to use Webkit based on reading and this discussion:

https://support.wikitude.com/support/discussions/topics/5000092655


How do I call and set shouldUseWebKit? I know it is a boolean, but I do not know where and how to call it.


To put it in terms of the sample app. Do I set shouldUseWebKit:

  1. In the iOS source file of the plugin as I am with setting it to full screen?
  2. In the file that sets up and loads the world?
  3. In the world itself?
  4. Somewhere else?

And how exactly do I call it in which ever file it needs to be called in. I've tried accessing it in many ways and I've searched all through the docs but I can't find any examples of how to set this to true.

Thank you if anyone can explain this to me.

After experimenting I partially resolved it.


If I put this code in the plugin then it eventually loads it properly using WebKit:

 

WTArchitectView.shouldUseWebKit = YES;


REMAINING PROBLEM: WebKit is not used until the second time I open the AR world. By this I mean I open up the world once and it doesn't work. I close then come back in and then it works and WebKit is used.

I assume this is because I do not know where to put the right code.

Can someone please advise me on the proper code and placement for setting the shouldUseWebKit boolean to true? Once it is set it works, but I have not got it to set on the initial load (I think because of improper placement).

Thank you!

Note: I am not sure if "WTArchitectView.shouldUseWebKit;" is even the right line of code to use. Or if I should be writing it in the Objective-C src. I am taking shots in the dark right now, and have only hit on that when it does use WebKit it works.


Not sure what the best line of code is, and in what file/line to put it, so it runs with WebKit from the start.



 

I think I finally found a solution. I put:

WTArchitectView.shouldUseWebKit = YES;
Into:
plugins/com.wikitude.phonegap.WikitudePlugin/src/ios/WTARViewController.m
@ line51
Below:
// Custom initialization
_startupConfiguration = [[WTArchitectStartupConfiguration alloc] init];

 Is this the recommended code and location? Or is there a better solution?

Hi,


This has been marked as solved, but is this the recommended best practice code and position for the change of the shouldUseWebKit to YES?


Is this how Wikitude suggests we make this change? I say we because I anticipate anyone using below 8.9 on iOS 13 will also be making this change and it is not in the documentation.


Thank you for your help,

Eric

Login or Signup to post a comment