[Oskari-user] Oskari RPC and Cordova Android app issue

Puikkonen Klaus (Ruoka) ext.klaus.puikkonen at ruokavirasto.fi
Fri Apr 12 00:10:21 PDT 2019


Hi,


just WebView for the iframe is ok.


In the browser that works fine. But when I try this in android phone with cordova "Osakari onReady" newer occurs.


try {
  channel = OskariRPC.connect(
    documentItem,
    mapAddr
  );
  channel.onReady(res => {
    this.loggerService.debugBuffer("Oskari onReady: " + res.clientSupported + " " + res.version);
  });


We are using https://hkp.maanmittauslaitos.fi maps.


This might be a reason maybe...but what can I do to allow this?:


Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://hkp.maanmittauslaitos.fi') does not match the recipient window's origin ('file://').",


-klasu

________________________________
Lähettäjä: Mäkinen Sami (MML)
Lähetetty: 12. huhtikuuta 2019 9:58
Vastaanottaja: Puikkonen Klaus (Ruoka); Oskari-user at lists.osgeo.org
Aihe: VS: Oskari RPC and Cordova Android app issue

Hi,

Do you need the "parent page" or can you just do a WebView for the iframe src/the map? Most of the Google search results related to postMessage in WebView seems to deal with how to communicate between Java and Javascript by sending and receiving messages using the postMessage().

BR,
          Sami

Lähettäjä: Oskari-user <oskari-user-bounces at lists.osgeo.org> Puolesta Puikkonen Klaus (Ruoka)
Lähetetty: torstai 11. huhtikuuta 2019 16.02
Vastaanottaja: Oskari-user at lists.osgeo.org
Aihe: [Oskari-user] Oskari RPC and Cordova Android app issue


Hi,



does anybody have idea or knowledge how Oskari RPC could work with Cordova and Android Webview. With browser everything works fine but in Webview postmessages does not work for some reason.



For example:


this.channel.postRequest(
  'MapMoveRequest', [x, y, zoomlevel]
);?
does nothing.

I'm trying to convert www application to simple android app....the applications for herders. They take pictures and locations of dead reindeers... the location are shown in the map which is in iFrame.

br

klasu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/oskari-user/attachments/20190412/632008b9/attachment.html>


More information about the Oskari-user mailing list