Deploy QML webview application to Mac OS App Store.
-
Hi,
i have an application which is mainly written in C++ with QWidgets and uses QtWebEngine.
Because of the QtWebEngine restrictions for the Mac OS App Store i am thinking of replacing the QtWebEngine related code by a QML Widget with webview.
Is webview allowed for the App Store, or are there any private and forbidden API calls internally?Or maybe there is another way to just display web content inside my application and get it accepted by the Mac OS App Store?
Greetings
Nando -
This is exactly what Qt WebView was made for. On iOS, it uses UIKit, which is public API. I therefore don't see why an app using Qt WebView shouldn't be accepted by the Apple Store.
-
I see. On macOS, Qt WebEngine indeed uses private API that the App Store might reject. We had maintained a flag to disable this use in earlier versions (use appstore_compliant_code in 5.6), but we had to drop it AFAIK in 5.10 again because it was not maintainable.
You can force Qt WebView to use the native backend also on macOS; set QT_WEBVIEW_PLUGIN=native in the environment. Anyhow, there are known shortcomings for this on macOS, so your mileage might vary.
-
@kkoehne said in Deploy QML webview application to Mac OS App Store.:
Anyhow, there are known shortcomings for this on macOS, so your mileage might vary
Do you mean i need to set QT_WEBVIEW_PLUGIN=native
when compiling my application (in qtcreator build settings -> Build environment) ?I tried it but then when running macdeployqt still get this:
Running macdeployqt WARNING: Plugin "libqtwebview_webengine.dylib" uses QtWebEngine and is not Mac App store compliant. WARNING: Skip plugin "libqtwebview_webengine.dylib"
Where and how do i need to set QT_WEBVIEW_PLUGIN=native ?
Thank you very much for your support. -
@kkoehne said in Deploy QML webview application to Mac OS App Store.:
I see. On macOS, Qt WebEngine indeed uses private API that the App Store might reject. We had maintained a flag to disable this use in earlier versions (use appstore_compliant_code in 5.6), but we had to drop it AFAIK in 5.10 again because it was not maintainable.
You can force Qt WebView to use the native backend also on macOS; set QT_WEBVIEW_PLUGIN=native in the environment. Anyhow, there are known shortcomings for this on macOS, so your mileage might vary.
Hi,
i now compiled webview with QT_WEBVIEW_PLUGIN=native
and then rebuilt my application.
I see this log output when starting my application:Setting QT_MAC_WANTS_LAYER=1 and QSG_RENDER_LOOP=basic
The webview qml is loaded but nothing is displayed. I Just see an emtpy rectangle without web stuff like before.
So now it doesn't also when starting directly after building from QtCreator without macdeployqt stuff...
Maybe you have an idea @kkoehne ?
-
Sorry for not coming back to you earlier ...
@Nando said in Deploy QML webview application to Mac OS App Store.:
Where and how do i need to set QT_WEBVIEW_PLUGIN=native ?
It's a runtime environment variable. That is, you have to set it before launching your application. If you want to do it programmatically you can add a qputenv() call early on in your main.cpp (preferably before Q[Gui|Core]Application is instantiated).
I see this log output when starting my application:
Setting QT_MAC_WANTS_LAYER=1 and QSG_RENDER_LOOP=basic
This is normal output on macOS, AFAIK.