<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tiles not responding in custom IOS App in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Tiles-not-responding-in-custom-IOS-App/m-p/15117#M150</link>
    <description>&lt;P&gt;Hi, I am working on&amp;nbsp;integrating PowerBI in an IOS App. So far everything is good except that tiles do not responde when I tap on them. Only tiles with maps respond (&lt;A href="http://stackoverflow.com/questions/34814221/powerbi-tile-issue-ios" target="_blank"&gt;I have posted about it on StackOverFlow&lt;/A&gt;) and only in certain places (see the red border in the image at the end, I added the border using Photoshop)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the HTML Code I'm using (which works perfectly on Android)&lt;/P&gt;&lt;PRE&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta name="viewport" content="initial-scale=1.0" /&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;
    // listen for message to receive tile click messages.
    if (window.addEventListener) {
        window.addEventListener("message", receiveMessage, false);
    } else {
        window.attachEvent("onmessage", receiveMessage);
    }

    //The embedded tile posts messages for clicks to parent window. Listen and handle as appropriate
    function receiveMessage(event) {
        messageData = JSON.parse(event.data);
        if (messageData.event == "tileClicked"){
            window.webkit.messageHandlers.callbackHandler.postMessage(messageData.navigationUrl.toString());
        }
    }


    function updateEmbedReport() {
            var w = window.innerWidth - 25;
            var h = window.innerHeight;

            // check if the embed url was selected
            var embedUrl = "";

            var iframe = document.getElementById('iframe1');
            iframe.src=embedUrl;
            iframe.onload = postActionLoadReport;
            iframe.height = h;
            iframe.width = w;

    }

    function postActionLoadReport() {
        // get the access token.
        accessToken = ;

         var w = window.innerWidth - 25;
         var h = window.innerHeight;

        // construct the post message structure
        var m = { action: "loadTile", accessToken: accessToken, height: h, width: w};
        message = JSON.stringify(m);

        // push the message.
        iframe = document.getElementById('iframe1');
        iframe.contentWindow.postMessage(message, "*");
        iframe.height = h;
        iframe.width = w;
      }

&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body onload="updateEmbedReport()"&amp;gt;
&amp;lt;iframe id="iframe1" width="250px" frameBorder="0" name="iframe1" height="250px" style="cursor:pointer"/&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;Swift Code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private var mWebView: WKWebView?
override func awakeFromNib() {
    super.awakeFromNib()
    let mWebViewConfig: WKWebViewConfiguration = WKWebViewConfiguration()
    mWebViewConfig.userContentController.addScriptMessageHandler(self, name: "callbackHandler")
    mWebViewConfig.preferences.javaScriptEnabled = true
    mWebViewConfig.preferences.javaScriptCanOpenWindowsAutomatically = true
    self.mWebView = WKWebView(frame: self.frame, configuration: mWebViewConfig)
    //self.mWebView!.scrollView.scrollEnabled = false
    self.addSubview(self.mWebView!)
}

func setData(url: String, tileClick: ITileClick){
    self.mTileClick = tileClick
    let page: String = (InstanceReferences.mPowerBIHandler?.GetPage(InstanceReferences.mAuthenticationToken!, EmbedURL: url, ReportPage: false))!
    self.mWebView?.loadHTMLString(page, baseURL: NSURL(string: url)!)
}
func userContentController(userContentController: WKUserContentController, didReceiveScriptMessage message: WKScriptMessage) {
print("iniside")
if message.name == "callbackHandler" {
    self.mTileClick?.OnTilePageClick("\(message.body)")
}   
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AJWly.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1882i73B784882CC24BB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="AJWly.jpg" alt="AJWly.jpg" /&gt;&lt;/span&gt;﻿&lt;/P&gt;</description>
    <pubDate>Sat, 16 Jan 2016 11:34:03 GMT</pubDate>
    <dc:creator>OmarBizreh</dc:creator>
    <dc:date>2016-01-16T11:34:03Z</dc:date>
    <item>
      <title>Tiles not responding in custom IOS App</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Tiles-not-responding-in-custom-IOS-App/m-p/15117#M150</link>
      <description>&lt;P&gt;Hi, I am working on&amp;nbsp;integrating PowerBI in an IOS App. So far everything is good except that tiles do not responde when I tap on them. Only tiles with maps respond (&lt;A href="http://stackoverflow.com/questions/34814221/powerbi-tile-issue-ios" target="_blank"&gt;I have posted about it on StackOverFlow&lt;/A&gt;) and only in certain places (see the red border in the image at the end, I added the border using Photoshop)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the HTML Code I'm using (which works perfectly on Android)&lt;/P&gt;&lt;PRE&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta name="viewport" content="initial-scale=1.0" /&amp;gt;

&amp;lt;script type="text/javascript"&amp;gt;
    // listen for message to receive tile click messages.
    if (window.addEventListener) {
        window.addEventListener("message", receiveMessage, false);
    } else {
        window.attachEvent("onmessage", receiveMessage);
    }

    //The embedded tile posts messages for clicks to parent window. Listen and handle as appropriate
    function receiveMessage(event) {
        messageData = JSON.parse(event.data);
        if (messageData.event == "tileClicked"){
            window.webkit.messageHandlers.callbackHandler.postMessage(messageData.navigationUrl.toString());
        }
    }


    function updateEmbedReport() {
            var w = window.innerWidth - 25;
            var h = window.innerHeight;

            // check if the embed url was selected
            var embedUrl = "";

            var iframe = document.getElementById('iframe1');
            iframe.src=embedUrl;
            iframe.onload = postActionLoadReport;
            iframe.height = h;
            iframe.width = w;

    }

    function postActionLoadReport() {
        // get the access token.
        accessToken = ;

         var w = window.innerWidth - 25;
         var h = window.innerHeight;

        // construct the post message structure
        var m = { action: "loadTile", accessToken: accessToken, height: h, width: w};
        message = JSON.stringify(m);

        // push the message.
        iframe = document.getElementById('iframe1');
        iframe.contentWindow.postMessage(message, "*");
        iframe.height = h;
        iframe.width = w;
      }

&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body onload="updateEmbedReport()"&amp;gt;
&amp;lt;iframe id="iframe1" width="250px" frameBorder="0" name="iframe1" height="250px" style="cursor:pointer"/&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/PRE&gt;&lt;P&gt;Swift Code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;private var mWebView: WKWebView?
override func awakeFromNib() {
    super.awakeFromNib()
    let mWebViewConfig: WKWebViewConfiguration = WKWebViewConfiguration()
    mWebViewConfig.userContentController.addScriptMessageHandler(self, name: "callbackHandler")
    mWebViewConfig.preferences.javaScriptEnabled = true
    mWebViewConfig.preferences.javaScriptCanOpenWindowsAutomatically = true
    self.mWebView = WKWebView(frame: self.frame, configuration: mWebViewConfig)
    //self.mWebView!.scrollView.scrollEnabled = false
    self.addSubview(self.mWebView!)
}

func setData(url: String, tileClick: ITileClick){
    self.mTileClick = tileClick
    let page: String = (InstanceReferences.mPowerBIHandler?.GetPage(InstanceReferences.mAuthenticationToken!, EmbedURL: url, ReportPage: false))!
    self.mWebView?.loadHTMLString(page, baseURL: NSURL(string: url)!)
}
func userContentController(userContentController: WKUserContentController, didReceiveScriptMessage message: WKScriptMessage) {
print("iniside")
if message.name == "callbackHandler" {
    self.mTileClick?.OnTilePageClick("\(message.body)")
}   
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AJWly.jpg" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/1882i73B784882CC24BB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="AJWly.jpg" alt="AJWly.jpg" /&gt;&lt;/span&gt;﻿&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 11:34:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Tiles-not-responding-in-custom-IOS-App/m-p/15117#M150</guid>
      <dc:creator>OmarBizreh</dc:creator>
      <dc:date>2016-01-16T11:34:03Z</dc:date>
    </item>
  </channel>
</rss>

