Tweet Widget not working in Cordova and iOS

ios
widgetsjs
cordova

#1

Hello everyone,

I am trying to use the Twitter JavaScript SDK to display embedded Tweets in a Cordova / Ionic application. And it is not working.

It works perfectly well with the embed codes suggested on the Twitter website if I use it in a classic website or even on Android using Cordova / Ionic.

However it does not work when running the same code under iOS. The network requests can be seen but the embedded HTML stays “unrendered”.
If I try to create a tweet with the SDK (see: https://dev.twitter.com/web/javascript/creating-widgets) an iframe is created but it only contains an empty HTML container. I tried a lot using different approaches and debugging but I cannot seem to find the problem.

There are lots of threads around the web (and here as well: Unable to embed timeline in Ionic App but closed whatsoever). I cannot find real solutions so I try to open up this topic again and bring it to a solution hopefully.

If more info is needed I am happy to provide everything needed.


Twitter widget on iOS devices not rendered for ionic app
#2

Have you tried using an ATS workaround for your app? Without more logging we can’t say for sure what the issue is, but that’s one option. http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/

If you can configure and use Charles to intercept network traffic, that would also be beneficial to debugging this issue.


#3

Thank you, @stevenhepting, for your input!

ATS is disabled by default in Cordova/Ionic but I have been looking into that as well.

I will try to use Charles to see what’s happening but I don’t think the network is the issue as the widgets are requesting the extra resources to render the Tweet but it’s just not happening visually.

I can send a demo app if you want to see it yourself or if it helps in any way.


#4

Sure, feel free to send a demo app for us to investigate. shepting at twitter com


#5

The last time I checked and looked into this, it seemed that Twitter embeds just won’t work on iOS with Cordova. There’s been a few discussions, none of which ever really had a solution other than opening the tweet in the InApp Browser Embedded Timelines in a PhoneGap application

This thread suggests it may be a security issue?


#6

@RobBoland2: As far as I am concerned at least the initial request runs without problems and even an empty iframe is created when “rendering”. Though - the iframe stays empty. As you can see in your linked threads as well.

@stevenhepting: I uploaded a quick demo app. You need cordova and ionic to run it. You can see the difference in Android and iOS. The first is working as expected. The second not.

Ionic install instructions: http://ionicframework.com/docs/guide/installation.html

If you have done that you should be able to run the app by open up a terminal and run “ionic emulate android” (or “ios”).

Demo app download: https://www.dropbox.com/s/hmixqcu7i2gu3yz/twitter.zip?dl=0

Please let me know if you need more help starting it.

Thanks again!


#7

@stevenhepting: Hey. Did you guys have had a chance to take a quick look into the issue already? I’m just afraid that this topic gets closed without someone looking into it. :slight_smile: Thank you!


#8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.


Embed Twitter not working in ios cordova app