I'm trying to get my app able to share a URL using Twitter.
As my Sencha Touch app is essentially HTML I assume I can use Twitter's @Anywhere Tweetbox (https://dev.twitter.com/docs/anywhere/welcome#tweetbox) within a Ext.Panel. However it does not work in my Sencha app.
I load the panel with the following code:
Code:
var popup = new Ext.Panel({ floating: true,
centered: true,
modal: true,
width: 300,
height: 400,
hideOnMaskTap: true,
showAnimation: {
type: 'popIn',
duration: 250,
easing: 'ease-out'
},
hideAnimation: {
type: 'popOut',
duration: 250,
easing: 'ease-out'
},
scrollable: 'vertical',
html: '<!DOCTYPE HTML><html><head><meta http-equiv="Content-type" content="text/html;charset=utf-8"><title>Anywhere Sample</title><script src="http://platform.twitter.com/anywhere.js?id=APIKEY&v=1" type="text/javascript"></script></head><body><div id="tbox"></div><script type="text/javascript">twttr.anywhere(function (T){T("#tbox").tweetBox({height: 100, width: 400, defaultContent: "<YOUR DEFAULT TWEETBOX CONTENT HERE>" });});</script></body></html>',
dockedItems: [{
xtype: 'toolbar',
title: 'Twitter',
docked: 'top',
items: [{
xtype: 'spacer'
}, {
text: 'Close',
handler: function() {
popup.hide();
}
}]
}],
});
For clarity, my html param is:
Code:
<!DOCTYPE HTML><html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Anywhere Sample</title>
<script src="http://platform.twitter.com/anywhere.js?id=APIKEY&v=1" type="text/javascript"></script>
</head>
<body>
<div id="tbox"></div>
<script type="text/javascript">
twttr.anywhere(function (T) {
T("#tbox").tweetBox({
height: 100,
width: 400,
defaultContent: "<YOUR DEFAULT TWEETBOX CONTENT HERE>"
});
});
</script>
</body>
</html>
My APIKEY is a valid key, and this code works fine when I save it as a HTML file and open it in my web browser.
I would like to know why this does not work? Finally, I get no errors from Chrome's web inspector either.