Display Facebook like box in PhoneGap in the same WebView / page?
How can I display a Facebook like box in PhoneGap in the same WebView / page as the remaining web application? I want to display a Facebook like box in a PhoneGap application (using jQuery Mobile).
PhoneGap opens a new browser window / webview for the Facebook like box.
Same situation with other Facebook social plugins. I want the like box to be part of the normal content on that page, not open a childbrowser or so. Either of both variants (FBXML [1] & iframe [2]) displays nicely in the same page on desktop browsers, but PhoneGap opens them in a new window, thereby leaving the application.
Any suggestions?
[1]:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like-box href="http://www.facebook.com/platform" width="292" show_faces="true" border_color="" stream="true" header="true"></fb:like-box>
[2]:
<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fplatform&width=292&colorscheme=light&show_faces=true&border_color&stream=true&header=true&height=427" scrolling="no" frameborder="0" style="border:none; overflow:hidden; wid开发者_开发问答th:292px; height:427px;" allowTransparency="true"></iframe>
Openeing iframes requires the domain to be added to the ExternalHosts key in PhoneGap.plist. Then the external page like Facebook show up in the normal content.
"You'll have to add the domain under the ExternalHosts key in PhoneGap.plist." link
精彩评论