Sailfish Share API and Sailfish WebView

Indeed, code assistance for the Sailfish.WebView package is still missing in the initial release.

It’s probably in place with 3.6?

Unfortunately not, as this relies on bits supplied on the OS side. I.e., it will be fixed for build targets matching some of the future OS releases and it will remain unfixed for 4.2.0.21 build targets even with newer SDK.

Ok, is there any place other than here we should mention that? I just went and ignored the error which ‘just worked’ but might have ‘despaired’ it I didn’t have such a thick skull.

1 Like

Anyone doing a forum search should find this thread quite easily. But if you have any ideas where else that could be mentioned, please let us know.

1 Like

Random, but how long has the share API been part of the OS?
So I can hide it for older OS versions it doesn’t work on

See first post: The Sailfish OS 4.2.0 release …

API’s are sometimes part of the OS before they are official announced and allowed on harbour, like the WebView API which was inside the OS in 4.1 as dev but announced in 4.2…

Hence why I’m I’m asking.

4.2.0 introduced: Sharing system redone

With SDK 3.6.6 I got this message in QTCreator with Webview:

[W] unknown:1283 - file:///usr/lib/qt5/qml/Sailfish/Silica/PageStack.qml:1283:13: QML AnimatedLoader: (file:///usr/share/harbour-ieligweb/qml/pages/SailfishWebviewPage.qml:5:1: module “Sailfish.WebView” is not installed
import Sailfish.WebView 1.0
^)

The lines mention above in .pro and .yaml are added. Any hints? Thx.

And in the SDK installation directory in “mersdk/targets/…/qml/Sailfish/Silica” there is no entry for “WebView”. Is this needed? On the phone there are entries for WebView and Share.

I needed two or three takes to get it installed. I think I did a buildrequires to get the SDK to push it to the target. In any case, just including it in Requires didn’t work ‘the first time’. I should have documented.

@vige Can we have a “How-To for dummies”? Thx.

As stated earlier, code assistance is missing for Sailfish.WebView in the initial release (4.2.0.21 build targets).

You can use Tools > Options > Sailfish OS > Build Engine > Manage Build Targets... > Manage Packages to install sailfish-components-webview-qt5 under your 4.2.0.21 build targets, which will fix the module “Sailfish.WebView” is not installed warning. But still, the code assistance for types provided by that module will not be available.

(If it was a true build-time dependency, the preferred way would be to add it to BuildRequires as @poetaster suggested. But here we are adding it just to make the IDE happy, so it’s not a true build-time dependency. In future build targets it will be preinstalled by default.)

1 Like

I’m sorry but you need to be a bit more specific. How-To for what?

@martyone , @vige : Thanks, but it is not solved for me. After installing sailfish-components-webview-qt5 the kits where invalid, a messages says: run make". So I made a new installation of the SDK without installing sailfish-components-webview-qt5.

Now I got in deployment:
Please confirm installation on device.
harbour-ieligweb: nothing provides ld-linux-armhf.so.3 needed by harbour-ieligweb-0.4.0-1.i486 (code: 13)
Installation failed

This occurs at the end of the deployment process after confirming installation in the emulation machine.
This error is a new one for me from today. After installing SDK yesterday all was fine. Is there something to delete manually after deinstallation SDK?

The BuildRequires are set like descriped above incl. - qt5embedwidget. Is this enough?
Thx.

This is most likely because you have old arm object files in your build directory, where you are building the i486 package.

1 Like

After some cleaning the SDK is working .

With help from poetaster here now my “real” point: SailfishWebview runs on phones. but not at the emulator. Can you check this, please?

Thx.

That indeed is the case. Somehow I missed this when announcing the APIs. I hope this hasn’t caused too many wasted hours staring at the white screen on the emulator :frowning:

@vige The docs for Sailfish WebView QML Type described “linkClicked(string url)”. Sometimes it works. But sometimes not. Why?

My example: butenunbinnen.de. When clicked at a pic the new page is loading. But the signal “linkClicked” is sleeping well. Tested with Javascript on or off. SDK target is EA-armv7hl 4.3.0.12.

Thx.

I have no idea. May I suggest you open a new topic about your issue, and post a link to your source code? Perhaps someone can then help you figure out the problem.