Twitter OAuth Login Page on the iPhone - iphone

I have Twitter integrated into my application, with the help of Sharekit. Everything works pretty well except, if the user happens to tap on the "Sign Up" link on the Login/allow page, it goes to a non-sign up error page. Either a "Sorry that page doesn't exist" or "Hold up! Sorry the profile you were trying to view was suspended due to strange activity."
The account I'm using is working as far as logging in, posting etc. But that link seems to go off into space. Also if I click on the "Twitter Gear"/Application Icon the dialog (web view with the Twitter OAuth Authorize page loaded) just closes.
I can't find anything about how to configure stuff like this and everything else seemed to work pretty easily. The closest reference I could find was,this link Twitter API Issue 1045
Thanks in Advance for any help
Update:
I've been checking a few other apps with Twitter support. Most of the ones I've checked (TUAW,Joystiq,TFLN) seem to have rolled their own Twitter Login Page (using XAuth I assume) the one I found that uses the Twitter OAuth page (Shazam) actually takes you to mobile Safari and it exhibits the same behavior. Maybe I need to roll my own login?

I suggest you go into the ShareKit class files, go to the two .m files that have "twitter authorization" (im not sure which of the two it is, a simple search on xcode should find it) and change the invalid url that it is being sent to to this URL: https://mobile.twitter.com/signup
That should fix your problem!

I suggest using a packet sniffer on your device to determine the exact URL being called when you click the "Sign Up" link. There are plenty of ways to do this, but it is easier on jailbroken phones. Armed with the URL, you can see if it is potentially something you are doing wrong or indeed a twitter bug.

Try Jan Rain it makes it easy to integrate this functionality without errors.
http://www.janrain.com/products/engage/mobile

Here is a ShareKit folk I am using: https://github.com/baotuo/ShareKit
It looks do not have your issues and have much more improvement. You should give it a try.

When you implement twitter integration, you should not use the library which you used in older projects but download new twitter library. I had some problems with twitter oauth when I used older library. But after download and use new library, the issue was fixed.

Related

What's the correct way to authorize PhoneGap application to the Facebook?

I spent a while already to fix annoying issue with Facebook in PhoneGap app. And still a lot of things goes wrong with that. The thing is that I use Appery.io and Facebook plugin.
This is how my Facebook console looks now:
I suggest that localhost might be a reason of the issue. However, I got it into Facebook_Helper.js:
Everytime I try to sign in with FB account, I get the same error at the child window:
So what I've got is that app is authorized at this moment indeed, because there's a menu button at the navbar that allows me to navigate through FB profile:
The first issue lies in that the child window never gets closed automatically once user submitted Sign In form. And the second one is that I can't get the access token to the app directly. I know I'm doing something wrong, but I spend more than a week on that and nothing was clarified.
Honestly, I've no idea why it's not working. I saw a lot of apps written in PhoneGap that use the same authorization too, and they work as it should. Will be appreciate if you take a look into that and, maybe, advice something.
First, I don't see iOS or Android in your developer.facebook screenshot.
Second, you should implement native facebook integration if you are developing an app, if I understand correctly from your code, you are trying to handle only web browser version of authentication. Native integration is both the suggested way by facebook and platforms and better experience for end users. If users have facebook app installed, authenticating over fb app is more secure after all..
You can use a cordova plugin for facebook integration, here is one of the plugins (I am one of the authors): cordova-facebook plugin

Tweet (or facebook) status update from iPhone with predefined Text

Hey,
sorry to bother you again, but I can't get this to work and would appreciate a working example project.. I try to give my users the possibility to post a short, predefined message from inside my App on either twitter or facebook (both should be available, but it doesn't have to update both on the same action, so one button to "share on facebook", one button to "tweet about it", so if you have a solution for facebook, but not for twitter or vice versa, I'd happily take the solution you have, either facebook or twitter and go on searching for the other one). It's my first time trying to interact with facebook and twitter, so I need something like dummy-proof explanation.
I found MGTwitterEngine but it seems to be hell to get it working. I've found Ben Gottlieb's Twitter OAuth-iPhone bundle, inserted my data, "registered" my app, and stuck with a gray screen on my device.
I'd need a working example of an iPhone App Project, that manages to tweet or update the facebook status of a user (maybe after a short and painless(!) login). Than I'd happily fiddle around myself to get this working, but by now I only find links to Desktop-Applications, examples or demos that won't work out of the box, or expect you to have done this several times before -.-
Thanks for your help, and sorry if that is an easy question, but I can't find the answer I need..
Perhaps the easiest way to be able to publish to a number of different services is ShareKit. This supports sending messages to Twitter, Facebook and a bunch of other services.

Does Sharekit still work?

When I try and use Facebook with Sharekit, it pops up the login dialog, I fill in my credentials and then it just disapears (it does this in the sample project as well) Am I doing something wrong? Or is Sharekit just defunked? If so, any viable alternatives?
Yes it does. And it gets better - there is a new repo on github, which aims to bring it alive again, from the flood of various forks.
I'm using ShareKit on a current project. The Facebook integration performs this way sometimes, but I don't think it has anything to do with the library. Remember that the Facebook dialog is hosted by Facebook. It may have to do with a temporary hiccup on their end.
Sharekit still works. I love it and it saved me a ton of time. It absolutely works.
I have experienced this issue as well.
There is a bug with the sharekit when the user signing in has already authorized your app to access their facebook account.
If I go into facebook -> account settings -> apps and remove my app from the list of apps. I do not experience this bug the very next time I have to sign in to facebook through the sharekit.
I am working on a solution, as long as time permits!

iOS Facebook Integration

I am working on simple facebook integration that allows users to post high scores to their wall. The way doodlejump handles this is my inspiration. I have it functioning, but it's not very clean and I'm not sure what to do.
I followed the instructions at http://developers.facebook.com/docs/guides/mobile to get up and running. One of the first things it has you do it call [facebook authorize:nil delegate:self]. After that you can call [facebook dialog:#"feed" andParams:params andDelegate:self] to make a post to the users wall. I have two issues with this.
First, when you call authorize it exits your app as that is facebook's new desired methodology as part of "One Single Sign-On" (OSS). That ok, what isn't ok is that my app is doing this even if the user is already signed on. I do not see a way to check if the user is already signed on.
The second issue is that it exits my app to authorize my app to post something to facebook. It seems acceptable to exit the app to sign on to facebook. Most users will have already done this, so no big deal. But my app should not have to exit just to get user authorization to post something. DoodleJump doesn't do that but I'm not sure how.
I tried digging through old posts but the SDK has changed so a lot of them are no longer valid. Thanks.
Based on the latest Facebook SDK (located at Github) and it's example I have determined that this is the expected behavior.
It is built around the new fangled "fast app switching" so it looks like that is just what happens.
A little lame imo but if that's what Facebook engineers have determined to be the optimal process then so be it.
I was having the same problem. Turned out it was because I hadn't set the URL Schemas in info.plist Where it says to fut fbYOUR_APP_ID make sure that you do this how they say. Your plist file should say something like fb12345 and then it will identify that the user has logged in correctly. offline_access will then work as a result
Might not be the answer you are looking for, but the app 'Hipstamatic' connects with facebook for photo upload (which I assume/hope is a similar process as wall posting) from within itself.
It could be worth seeing if they would be able to guide you if you sent the devs an e-mail?
I think they solve this issue by calling an iframe of sorts within the app, connecting the app to facebook and performing facebook activities, then closing once complete.
Hope this helps!
What permissions are you requesting? If you don't ask for offline_access the framework will make the user log in each time.
You can also try ShareKit
It's an open source library for iOS to share links, images and more. It's very simple and also works with Twitter and other social networks.
The site also contains some video tutorial and some code examples to integrate the Facebook API, Check this

How can I add a link to an iPhone native app from website IF POSSIBLE

I have a link to a Facebook page from a website. I know I can use the URL scheme href="fb://" to open up the Facebook application from within an iPhone, but if the iPhone user does not have the native application installed, an ugly error message pops up. I would rather just send this user to the Facebook website.
There's gotta be a way to do this, but everything I've tried has had some short-coming:
Can't make a HEAD request to a different server
Can't run a try catch javascript function since the event leaves the client page
Can't seem to access information about the user's applications... or can I? I've read a bit about a cookie called "appInstalled" but can't find any real documentation about it.
Any ideas out there? Thanks a ton in advance.
Denis
Can a website determine if a device [iPhone] has certain applications installed ? I'm pretty sure that's a big NO because of privacy and security concerns.
Not a really technical answer, but you could change the user interface to give the user an option. For example, having:
Click here if you have the facebook application installed on your iPhone.
If you do not, click here to go through to the site.
Sorry that I cannot offer a "proper" solution, I'm not really that familiar with iPhone development.