I'm trying to integrate twitter to my mobile web app using only javascript, html5, and css. My app only has one url and we use wink to handle page navigation. The problem is whenever we goes out and come back (or even open a new url in the same window and back) to our mobile web app, the app got reload, and we don't want that to happen when we make a tweet.
So, for facebook, we include its own JavaScript SDK, and used FB.ui to handle share.
FB.ui({
method: 'feed',
name: 'name',
caption: 'caption',
description: 'desc',
link: 'link',
picture: 'pic'
},
function (response) {
console.log('response: ', response);
});
When we call that function, a popup will appear in the screen with close button. And when we close the fb popup, nothing happened to our main app. It also handles different behavior between iPhone and iPad.
So I want to do the same thing with twitter, to be able to tweet, retweet, follow, and favorite a tweet. First, I was using the twitter button, which always goes out to our main url and create a new window when click the button. Then, I tried to open the shared url in an iframe, later i found it is forbidden by twitter. Then, I want to use its API, but the write query like post a tweet would need a backend, which I don't want to have.
So far, I've tried with:
<a id="twitterURL" class="twitter_share" href="https://twitter.com/share?url=http%3A%2F%2Fwww.myapp.com&text=shareing">Share</a>
<a id="twitterURL" class="twitter_share" href="http://mobile.twitter.com/home?status=sharing">Share</a>
<a id="twitterURL" class="twitter_share" href="https://twitter.com/intent/tweet">Share</a>
The closest question i got from stackoverflow is Twitter connect from website without popup but it is not been answered fully, and the difference between him and mine is he's fine if the user accept, but mine is not since the app will refresh.
I'm new here, so if someone knows how to narrow down my words to make a simple but efficient question, please let me know as well, thanks!