I have a Flex application that uses the Last.fm and Twitter api. After I uploaded the project to my webspace, the Twitter api call doesn't work anymore, but the Last.fm still works. My url still works:
var getTweetsUrl = "https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=deftonesband&count=3"
This is the code used for the httpservice:
<s:HTTPService id="getTweetsService" url="{getTweetsUrl}" result="displayTweets(event)" fault="twitterFail(event)" resultFormat="e4x" />
Every time the fault event is fired, even though the url is correct. Anyone knows of this problem?
due to crossdomain policy of twitter.com (https://api.twitter.com/crossdomain.xml) you are not able to invoke twitter api from other domain without permission (locally there is no crossdomain check in flash player)
to get permission from twitter user you have to use oAuth
I think easiest way to implement oAuth for twitter api is to use Open Source library for AS3 called Tweetr:
http://wiki.swfjunkie.com/tweetr
Related
Good afternoon, I am creating an application in Cordova and wanted to use linkedin, but when I run my application, it says I need to set my domain javascript API in my Application linkedin. I've tried with the domain "file: ///" but gives the same error.
Does anyone have an idea or a solution to this problem?
Best Regards
LinkedIn (or any OAuth provider) requires your Web domain for security purposes (to know the right URL for authentication callbacks, and to help prevent random sites from trying to impersonate your application).
You must supply a domain such as www.yourdomainname.com or even your external IPv4 address will work, such as 55.55.12.12.
We have a web based system that we are looking at replacing our existing "help system" from uploading flash videos directly to our website to instead "embedding" content we upload to our vimeo account. We have setup a vimeo pro account and these videos need to be "private" i.e. not accessible to the general public. Which API version should I use? And do you have any sample code in say PHP I could take a peek at with the functionality we are after
The Advanced and Simple API's will no longer receive new features, and soon you will not be able to create new apps for them.
Vimeo has moved towards a unified API, which you can read about at http://developer.vimeo.com/api. Make sure to use the api through api.vimeo.com, not vimeo.com/api/rest/v2.
Vimeo has an official PHP library, with some very basic examples that you can see at http://github.com/vimeo/vimeo.php
This is for doing OAuth with the Pocket API, it specifically states that using an embedded webview is a violation of the terms of use, all OAuth examples I can find on WP8 seem to rely on the embedded webbrowser to do the authentication.
Is it not possible to use the default browser in WP8 to do the authentication and then redirect back into the App? I have done this in Android before. Thanks.
Well, if you read their documentation, it says that you need to provide a redirect URL. I am not sure if it will work, but you could try adding URI association to your application and specify callback URL that will return back to your app.
Then, when your application is reactivated from the default browser, you should know that the user has authorized it.
Thus you could use WebBrowserTask for that, but I am unaware if you can call local app-URI from browser.
I'm making an online game, that uses Wordnik API AS3 to fetch word definitions. Everything works fine when i'm testing localy (sandboxType: localTrusted). But when I upload my .swf (sandboxType: remote or localWithNetwork) I get Wordnik API response "Security error accessing url".
I've set "useNetworkServices" to true.
I'm doing:
Security.allowDomain("api.wordnik.com");
Security.loadPolicyFile("api.wordnik.com/crossdomain.xml");
It could be some issue with crossdomain.xml. When testing in localTrusted I get the debug message "api.wordnik.com does not specify meta-rule. using default meta-rule 'master-only'". I get similar message for Google Interactive Media Ads, but it defaults to 'by-content-type'. Google IMA works when uploaded, Wordnik doesn't.
I'm not even sure if the problem is on my side.
Helpful answer would provide a working solution for the security issue, or point to any application using Wordnik AS3 API online - maybe its developers could help.
:)
i know that the index.html page (the PhoneGap startup page) needs to reside on the device. but if we want to create an app who uses third party user authentication before proceeding to core application, so then what we have to do?
Thanks in advance
On android you can change the starting page in the main activity or you can make a redirect in index.html
Well, you don't say if you are platform specific..
And there are lots of third party auth options..
But I can offer two solutions (admittedly my own code etc),
both of them use PhoneGap for Android and PhoneGap Plugins. The key piece of code for me has been the onLocationChange callback feature of the ChildBrowser plugin. Your app can take the user to other sites for auth or whatever, but still get control back.
Tutorial on Using Twitter REST API (OAuth 1, ChildBrowser, jsOAuth plugin)
Free Android App + Source on github : AppLaud App (OpenID, ChildBrowser, custom server)
For authentication, you can have a form in your index.html (maybe under login div) to do a post to an actual webserver.
Then, fetch the data returned from the webserver to let your user access the functionality of your native phonegap application.
You can have the functionality disabled until you receive the successful login from the webserver. If you post via ajax, the webview won't even blink, but you will still get the successful login response from webserver and simply enable functionality on your app after this.
Let me know if this is confusing and I'll try to explain more clearly and
I hope this helps.