iOS Question WKWebView

Stefano Di Chiano

Active Member
Licensed User
Hi,
I'm making an app with B4i using webviews. I had some issues with uploading it and I had to switch to WKWebViews, but I still have my build rejected because they say I'm still using WebViews.
In another thread Erel told me that in B4i v6.50 WKWebViews are treated like normal WebViews.
I was using B4i v5.81, so I updated it but it looks like the last version is v6.50.
So how can I solve the WebView issue?
 

Semen Matusovskiy

Well-Known Member
Licensed User
I was using B4i v5.81, so I updated it but it looks like the last version is v6.50.
In IDE click Help - About program. Which release?

If 6.50, simply recompile. WebView will be automatically converted to WKWebView instead of UIWebView 5.81.

To be sure, you can do following. Rename .ipa to .zip and extract files. You will see executable module inside Payload folder. Open this module using File manager (for example, https://www.farmanager.com/files/Far30b5577.x64.20200327.msi ). Search unicode string UIWebView . If not found, all is Ok.
 
Upvote 0

ilan

Expert
Licensed User
What do you mean you are making an App that uses Webviews and Apple reject it because of the Webview?
I have few apps that use Web views and they are approved each time I send them to review.

What are you doing with the Webview? Apple will not reject your App only because it has a Webview.
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
I'm sorry, I wasn't clear.
I was making an app with B4i v5.81. In this app I use WebViews.
Once completed, I try to submit the ipa, and Apple Connect rejected it because WebViews are not accepted anymore, saying that I should use WKWebViews instead for security reasons.
I made the switch, but still getting rejected, for the same reason. I updated the library that include the WKWebViews and still getting rejected for the same reason. In the thread I linked before, Erel explained to me that in B4i v6.5, WKWebViews are treated like WebViews. So I imagine that the same is done with previous versions too, since I was running v5.81, but correct me if I'm wrong.
So I made the update, and I received B4i v6.5. I was thinking that maybe there was a newer release, but that's the one I received when updating.
So, basically I get my app rejected no matter what version of B4i I use, because WKWebViews are treated like normal ones.
Maybe I misunderstood what Erel told me, so I will try submit the app again with B4i v6.5.
With the webView I'm simply loading some urls.
Semen Matusovskiy does B4i make the convertion even without using the library iU18 for the custom view?
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
If you used Dim ... As WebView only, you don't need iUI8.

There are two different classes
1) https://www.b4x.com/b4i/help/views.html#webview
2) https://www.b4x.com/b4i/help/iui8.html#wkwebview

The last was in B4i 5.81 and remains in B4i 6.50. Nothing changed - B4I WKWebView is based on https://developer.apple.com/documentation/webkit/wkwebview?language=objc
If you used Dim ... As WKWebView , you need to preserve a reference to iUI8 library. But actually there no reasons to use WKWebView class now.

WebView (which is a part of iCore library) is another story.
In B4i 5.81 it corresponded to UIWebView https://developer.apple.com/documentation/uikit/uiwebview , which is now deprecated.
B4i 6.50 uses new iCore library and WebView corresponds to WKWebView https://developer.apple.com/documentation/webkit/wkwebview?language=objc
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
Ok, I tried again, but now when I launch the terminal command I get following error:
(Unable to validate your application. Could not determine the package's bundle id. The package is missing an Info.plist or the CFBundlePackageType is not 'APPL' or 'FMWK'.)

EDIT: I was able to run the command. But again, the app got rejected. This is what they said to me: "ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability.".
I don't know what to do anymore. No matter what I do I get the rejected for the same reason.
 
Last edited:
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
You should not change something manually. If you found 'UIWebView', means something wrong.

I can assume only. Are you sure that you compile in 6.5 ? Do you use Hosted or Local builder ?
If Local, maybe you did not update libraries.

Well, there is a simple, but not a fast way to find a problem.
Create a new (dummy) project. Add certificates. Create ipa and search UIWebView. Then step by step include libraries, which you use in real project.
Finally, you will find an 'enemy'
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
Are you sure that you compile in 6.5 ? Do you use Hosted or Local builder ?
Local builder. Well, if I run B4i v6.5 am I not compiling in v6.5? Is there something else? EDIT: I forgot that the builder is downloaded separately. I can't find the download link though in the Local Builder Installation tutorial.

If Local, maybe you did not update libraries.
The only library I'm using other than iCore is the one I found here. I don't think there is an updated version. But this should use ImageViews.

Create a new (dummy) project. Add certificates. Create ipa and search UIWebView. Then step by step include libraries, which you use in real project.
I will do this and report the results here.
 
Last edited:
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
I did the dummy project as you said. I found "UIWebView" inside of the ipa file. I didn't include any library other than iCore and I only used a WebView to load a google page.
I have B4i v6.50 now and iCore v6.5 as well.
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
On my PC there is no "UIWebView" in similar case.
Imagine that you really run B4i 6.50 under Windows.
Take a look a Mac. Are you sure that you run java -jar B4iBuildServer.jar from correct subfolder ?

libCore.a is dated Feb, 17, 2020. Size 3751296 bytes. If to look in Far Manager, there are "WKWebView" strings and there are no "UIWebView".
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
I think it was because of the builder. I downloaded the new version but now it doesn't compile.
After downloading the new local builder, what would be the next step to work with it? Is it enough to unzip it and call it by line command?
This is the error I'm getting:
Error:
The following build commands failed:

    CompileC /Users/antoniodichiano/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphoneos/B4iProject.build/Objects-normal/arm64/b4i_paginaweb.o /Users/antoniodichiano/Desktop/B4iBuildServer/UploadedProjects/<user id>/B4iProject/b4i_paginaweb.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

(1 failure)
 
Last edited:
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
I overwrite previous release. The reason is in additional libraries, which I use.

I keep current release in B4iBuildServer subfolder of Downloads. I extract B4iBuildServer_650.zip on desktop. Mac creates a folder B4iBuildServer_650. Then I move B4iBuildServer.jar and subfolder Libs to Download/B4iBuildServer (overwrite). Nothing more.
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
I finally solved it. Apparantely it was the HHAnimatedGifView library giving me the compiling problem. Now I just have to find another way to show a gif and submit.
EDIT: the problem wasn't the library. It was me. I was finally able to submit the app.
 
Last edited:
Upvote 0

ilan

Expert
Licensed User
I finally solved it. Apparantely it was the HHAnimatedGifView library giving me the compiling problem. Now I just have to find another way to show a gif and submit.
EDIT: the problem wasn't the library. It was me. I was finally able to submit the app.

use wkwebview to show the gif
 
Upvote 0

ilan

Expert
Licensed User
Upvote 0
Top