<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML-esimuotoiltu Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTML-esimuotoiltuChar
        {mso-style-name:"HTML-esimuotoiltu Char";
        mso-style-priority:99;
        mso-style-link:HTML-esimuotoiltu;
        font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal00, li.msonormal00, div.msonormal00
        {mso-style-name:msonormal0;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msochpdefault, li.msochpdefault, div.msochpdefault
        {mso-style-name:msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.html-esimuotoiltuchar0
        {mso-style-name:html-esimuotoiltuchar;
        font-family:Consolas;}
span.shkpostityyli21
        {mso-style-name:shkpostityyli21;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.Shkpostityyli26
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="FI" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Apparently WebView sees the iframe as having a file:// protocol. This might be due to the iframe not being loaded yet and happens on browser as well, but JSChannel recovers from this.
 If the message ever reached the iframe with the file:// protocol you would might see this kind of message
</span><a href="https://github.com/oskariorg/oskari-frontend/blob/master/bundles/framework/rpc/instance.js#L88"><span lang="EN-US">https://github.com/oskariorg/oskari-frontend/blob/master/bundles/framework/rpc/instance.js#L88</span></a><span lang="EN-US">.
 But if you can use just the iframe you could do the same things by running this kind of JS inside the map page:<br>
<br>
    Oskari.getSandbox().postRequestByName(</span><span lang="EN-US" style="font-size:12.0pt;color:black">'MapMoveRequest', [x, y, zoomlevel]</span><span lang="EN-US">);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">This would by-pass the postMessage() and call Oskari API directly.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">         Sami<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Puikkonen Klaus (Ruoka) <br>
<b>Lähetetty:</b> perjantai 12. huhtikuuta 2019 10.10<br>
<b>Vastaanottaja:</b> Mäkinen Sami (MML) <sami.makinen@maanmittauslaitos.fi>; Oskari-user@lists.osgeo.org<br>
<b>Aihe:</b> VS: Oskari RPC and Cordova Android app issue<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-size:12.0pt;color:black">Hi,<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">just </span><span style="color:#212121;background:white">WebView for the iframe</span><span style="font-size:12.0pt;color:black"> is ok.<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">In the browser that works fine. But when I try this in android phone with cordova "Osakari onReady" newer occurs. <o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<pre style="background:white"><b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:navy">try </span></b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">{<br>  </span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#458383">channel </span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">= </span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#458383">OskariRPC</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">.</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#7A7A43">connect</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">(<br>    </span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#458383">documentItem</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">,<br>    mapAddr<br>  );<br>  </span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#458383">channel</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">.onReady(res => {<br>    </span><b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:navy">this</span></b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">.</span><b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#660E7A">loggerService</span></b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">.</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#7A7A43">debugBuffer</span><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">(</span><b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:green">"Oskari onReady: " </span></b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">+ res.clientSupported + </span><b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:green">" " </span></b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">+ res.</span><b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:#660E7A">version</span></b><span style="font-size:9.0pt;font-family:"Menlo",serif;color:black">);<br>  });<o:p></o:p></span></pre>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">We are using <a href="https://hkp.maanmittauslaitos.fi">https://hkp.maanmittauslaitos.fi</a> maps. <o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">This might be a reason maybe...but what can I do to allow this?:<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (’https://hkp.maanmittauslaitos.fi') does not match the recipient window’s origin (‘file://’).“,<o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p><span style="font-size:12.0pt;color:black">-klasu<o:p></o:p></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-size:12.0pt;color:#212121">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">Lähettäjä:</span></b><span style="color:black"> Mäkinen Sami (MML)<br>
<b>Lähetetty:</b> 12. huhtikuuta 2019 9:58<br>
<b>Vastaanottaja:</b> Puikkonen Klaus (Ruoka); <a href="mailto:Oskari-user@lists.osgeo.org">
Oskari-user@lists.osgeo.org</a><br>
<b>Aihe:</b> VS: Oskari RPC and Cordova Android app issue</span><span style="font-size:12.0pt;color:#212121">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#212121"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">Hi,<br>
<br>
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().</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121"> </span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">BR,</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">          Sami</span><span style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121"> </span><span style="color:#212121"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="color:#212121">Lähettäjä:</span></b><span style="color:#212121"> Oskari-user <<a href="mailto:oskari-user-bounces@lists.osgeo.org">oskari-user-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Puikkonen Klaus (Ruoka)<br>
<b>Lähetetty:</b> torstai 11. huhtikuuta 2019 16.02<br>
<b>Vastaanottaja:</b> <a href="mailto:Oskari-user@lists.osgeo.org">Oskari-user@lists.osgeo.org</a><br>
<b>Aihe:</b> [Oskari-user] Oskari RPC and Cordova Android app issue<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="color:#212121"> <o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black">Hi,</span><span style="font-size:12.0pt;color:#212121"><o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"> </span><span style="font-size:12.0pt;color:#212121"><o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black">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.</span><span style="font-size:12.0pt;color:#212121"><o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"> </span><span style="font-size:12.0pt;color:#212121"><o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black">For example:</span><span style="font-size:12.0pt;color:#212121"><o:p></o:p></span></p>
<p><span style="font-size:12.0pt;color:black"> </span><span style="font-size:12.0pt;color:#212121"><o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">this.channel.postRequest(</span><span style="color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">  'MapMoveRequest', [x, y, zoomlevel]</span><span style="color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">);​</span><span style="color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">does nothing.</span><span style="color:#212121"><o:p></o:p></span></p>
</div>
<pre style="background:white"><span style="font-family:"Calibri",sans-serif;color:black;background:white">I'm trying to convert www application to simple </span><span style="font-family:"Calibri",sans-serif;color:black">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.</span><span style="color:#212121"><o:p></o:p></span></pre>
<pre style="background:white"><span style="color:black">br</span><span style="color:#212121"><o:p></o:p></span></pre>
<pre style="background:white"><span style="color:black">klasu</span><span style="color:#212121"><o:p></o:p></span></pre>
</div>
</div>
</div>
</div>
</body>
</html>