I was wondering if anybody has ever been successful in implementing a Twitter embedded timeline in their Ionic app?
I have been able to get it to work in the desktop browser, but when I run the app on simulator or device, the widget won’t work. I’ve done some searching and basically everywhere (Stackoverflow / Twitter forums / other sources) there are people saying it isn’t possible to get the standard Twitter embedded timeline widget to work within a Cordova / Phonegap context, for very vague reasons.
Has anybody here had any success getting this to work?
I’m using <access origin="*" /> in my config.xml. When I inspect the app with Safari I see that data is being retrieved from Twitter’s cdn, but the widget itself just won’t render.
I’ve done some digging and basically everyone seems to be stuck on this at the moment… Extremely frustrating.
Thanks @mhartington! I’m gonna check this out. I suspect this might not work anymore since Twitter changed their API’s a while back to 1.1. But I might be wrong. Will report back once I know more.
My 2 cents here. I’m planning on implementing this on my ionic app shortly just by going via my server. It’s pretty simple to get twitter hooked up to a PHP backend which I’ve done already then just make it available on an API, which I’ll do shortly. I’ll publish the code when I’m done.
However, aaron’s solution above looks neat and prevents the need of a backend server. Looks like the full code is there in the services.js file for the twitter integration
@mattm I’m not 100% sure, but I dont think @coen_warmer wants to make a twitter login, more a general timeline for look at trending things ( like #ionicframework ), but I could be wrong
@coen_warmer, did some more research on this and found this article.
That’s right; I don’t need any authentication functionality in the app, I would just like to display tweets that have a certain hashtag. Similar (or even exactly like) the standard Twitter search timeline: https://dev.twitter.com/docs/embedded-timelines
Twitter provide a couple of 1-liner integrations which is what your link gives you access to. So if they do what you want, then that’s perfect. They provide limited customisation but if those examples do what you need, then perfect.
The old API allowed you to integrate without authentication which made client-side integration super simple. However in the newer version, now you have to create an API key. So it’s not like you’ve got to authenticate by logging in with twitter on the App, but you do need to create a key, secret & access token. Which you could then hard-code into the app settings.
This will then allow you to connect with the API and get what you need. So if you want to customise the look, do a search etc, then you may need to go down this route. But if you get it working using their examples, drop us a link. Would be great to see the results.