Embedded Twitter timeline in PhoneGap 3.1.0 application - twitter

I have an issue with integrating Twitter timeline with PhoneGap 3.1.0 application (iOS version)
1) I have generated a new PhoneGap 3.1.0 application
2) Have added iOS version
3) I have generated a timeline widget in Twitter
4) Have pasted the code from Twitter widget into the page:
index.html:
<a class="twitter-timeline" href="https://twitter.com/bill_hallam" data-widget-id="399136844954087424">Tweets by #bill_hallam</a>
<script>!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");</script>
5) Have whitelisted twitter domains:
config.xml:
<access origin="https://twitter.com" subdomains="true" />
<access origin="http://twitter.com" subdomains="true" />
<access origin="http://platform.twitter.com" />
<access origin="https://platform.twitter.com" />
<access origin="https://cdn.syndication.twimg.com" />
<access origin="http://cdn.syndication.twimg.com" />
6) Started the iOS emulator from Xcode
Result: The page is blank. Safari Develop console shows that twitter <iframe> tag is embedded in the page. All js/css files retrieved successfully. None if them was blacklisted.
Does anyone have succesfull experience integrating Twitter timeline into PhoneGap 3.1 app?

Update Nov 29 2016
This is most probably not the issue the OP faced back then, but if anyone faces the same issue these days (using Cordova 6.4.0, as of Nov 29 2016), the answer is to add:
<allow-navigation href="about:*" />
to your config.xml.
This is required to be able to open the about:blank URL initially used by the iframe set up by the Twitter timeline widget.

I have finally figured out a way to do that.
Unfortunately at the moment the only solution I have found is using an InAppBrowser plugin.
But it works for both - iOS and Android versions.
The detailed description is here
I have created a small public page, that functions as a service.

Related

allow-navigation isn't taking precedence over allow-intent on iOS

I generated an iOS and Android Pollyfill for my PWA app with PWAbuilder. It is working great on Android, but I'm running into an issue on the iOS one.
I want external links to open in the external browser, so I added this allow-intent:
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
This worked fine, if I click on any external link (not-under-my-domain.com), it opens in the external browser.
For opening my-domain.com within the app, I added
<allow-navigation hap-rule="yes" href="*://my-domain.com/*" />
According to the docs, allow-navigation should take precedence over allow-intent, but it does not seem to be working.
Then if I click on any link within my domain, such as /other-page, it opens in the external browser - which isn't expected, it should open within the app.
I would like to have any link not defined in allow-navigation to open in the external browser, and all others (under my-domain.com) within the app.
Any ideas?
So after all it seems the problem was with my outdated version of cordova. I upgraded the cordova version following #jcesarmobile's suggestion on the comments and it is working now.
npm install cordova -g
cordova plugin save
cordova platform rm ios
cordova platform add ios

Updating to cordova-ios 4.0 breaks XHR's on uiwebview

Trying to use the cordova-ios 4.0 so that I can take advantage of the wkwebview.
On ios9 devices, everything works using the wkwebview.
On ios8 and ios9 devices, XHR requests do not work at all when using the uiwebview (and ios8 seems to use the uiwebview instead of wkwebview).
If I "downgrade" to cordova-ios 3.8, everything works fine. I have the whitelist plugin installed, with the following in my config.xml:
<access origin="*" />
<access origin="tel:*" launch-external="yes" />
<access origin="geo:*" launch-external="yes" />
<access origin="mailto:*" launch-external="yes" />
<access origin="sms:*" launch-external="yes" />
<access origin="market:*" launch-external="yes" />
<allow-navigation href="*" />
<allow-intent href="*" />
<allow-navigation href="*" />
Weirdly, the config.xml seems to be ignored. When I build with cordova-ios 3.8, I get the splash screen, icon, etc. When I build with cordova-ios 4.0 everything is just generic cordova icon/splash.
I have also added the NSAppTransportSecurity bit to the plist file, though for ios8 it shouldn't make any difference.
The XHR calls I'm trying to make have CORS enabled on the server.
Specifically, I need help trying to figure out why I cannot make XHR requests on cordova-ios 4.0.
So, apparently I needed to install the whitelist plugin at version 1.1.1-dev, rather than 1.0.0. I'm not sure what exactly the difference is, but the former fixes whatever issue I was having. Whoops.

Phonegap Google Maps and whitelist rejection

I'm using Xcode to build an iOS app..
I'm trying to get google maps working on Phonegap 3.x but in the debug window it says:
2014-05-22 15:05:14.789 foo[9345:4503] ERROR whitelist
rejection:
url='https://maps.googleapis.com/maps/api/js?key=XXX&sensor=true'
Config.xml:
<access origin="*" />
I've tried this as well:
<access origin="*.googleapis.com" />
my-app.plist:
ExternalHosts | (String) | *
It doesn't seem to work at all!
Any ideas?
Solved!
In Xcode you can see the config.xml.. HOWEVER, it isn't the right config.xml.
The file to search for is here /path-to-app/platforms/ios/appname/config.xml
Just added:
<access origin="*" />
And woila!!
Hope this will help you to!

Phonegap 3.1 won't load external content, despite it being explicitly set

I realise this is a common problem and has been asked many times, however I do feel that no other answers work in this instance.
I have a basic PhoneGap application that works fine in browser, on the Android simulator, on Android devices in the XCode/iOS simulator. It does not work, however, on iOS devices. When adding external libraries the app essentially hangs. It doesn't crash, but tries to load it forever more, leaving a blank white screen.
I know this is a common problem, fixed by amending the config.xml to whitelist URLs, which I believe I have done, but I still get the same problem.
My config.xml has the following entry:
<access origin="*" subdomains="true" />
I have also tried the following:
<access origin="*" />
<access origin="*" subdomains="true" />
<access origin=".*" />
<access origin=".*" subdomains="true" />
All together and on their own, with no luck. After building to iOS (phonegap local build ios) I have also 'prepared' all of the plugins (cordova prepare).
I have tried several libraries, from various CDNs such as Google CDN and jQuery CDN. I have also tried adding an iframe with the following:
<iframe src="http://google.co.uk" width="250" height="500"></iframe>
Which gives me a blank iframe.
If I look at the build in XCode and look at the generated platform-specific config.xml files I can see the same access XML as expected.
I am using the below versions:
Phonegap 3.1.0-0.15.0
XCode 5.0
OSX 10.8.5
iOS 6.1.3 (iPod Touch)
iOS Simulator for iOS 7
Any help is much appreciated.

Phonegap Blackberry build error for cross domain

When i build my application from phonegap. It works in iPhone, iPad, Android but didn't work in blackberry.
I'm calling cross domain API WSDL.
In blackberry it gives error
URL (exmple :- http://google.com)- could not be retrieved because it was not found in config.xml.
Please verify the <access> elements in the WebWorks config. Contact your service provider if the problem persists.
I have to use in config.xml
<access subdomains="true" uri="*" /> OR <access origin="*" />
?
Last time I had this issue it seems all URL's have to be explicit for BB. If your URL is unknown at runtime (For instance, a user entered URL), The only way around it would be
<feature id="blackberry.app" >
<param name="websecurity" value="disable" />

Resources