html5 - How to embedded twitter widget into android phonegap -


i have tried embed twitter widget android apps, timeline not show. blank page when run on android devices. there configuration need make. fyi, using jquerymobile , phonegap make android apps.

thank you.

edit :

this code. copied on official twitter website. paste code inside body tag using html5 make android apps.

!function(d,s,id){var js,fjs=d.getelementsbytagname(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getelementbyid(id)){js=d.createelement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentnode.insertbefore(js,fjs);}}(document,"script","twitter-wjs");

there few things may need do.

i having issues twitter embedded timeline in phonegap build when on android , ios.

in config.xml whitelisted few different domains.

<access origin="https://twitter.com" subdomains="true" /> <access origin="http://twitter.com" subdomains="true" /> <access origin="http://platform.twitter.com" subdomains="true" /> <access origin="https://platform.twitter.com" subdomains="true" /> <access origin="https://cdn.syndication.twimg.com" /> <access origin="http://cdn.syndication.twimg.com" /> 

you may wondering came last ones. when running through chrome developer tools happened spot domain being accessed via twitter-provided script. may different depending on location, @ least it's starting point. , aware don't need duplicate secure , un-secure http, better safe sorry.

*edit*

i created new html document called twitterfeed.html. called onclick event method accessed new html page in inappbrowser. should you, still working on twitter intents.

  function twittertest(){  var ref = window.open('twitterfeed.html', '_blank', 'location=no');     }; 

calling function:

 <img id="twt_image" class="small_image"  src="assets/images/tw_image.png" alt="mctn_twitter" onclick="twittertest()"></img> 

i have mine opening image add onclick else.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -