Using OAuth.io iOS library to log into FitBit snag - ios

following OAuth.io simple two lines
OAuthIOModal *oauthioModal = [[OAuthIOModal alloc] initWithKey:PublicKey delegate:self];
[oauthioModal showWithProvider:#"fitbit"];
throws up the web view, with the proper FitBit page.
YAY
I fill in the email & password, tap "allow".
I then get the "green check" with the happy message "Authorized"..
--THEN-- the FitBit page says "please return to [The App] and enter the following PIN when requested".
problem 1) We're in [The App].. we never left it.. we're in a web view. there's no returning to the app
problem 2) Copying a PIN? that's really inconvenient.. especially on a mobile device. why can't it just be returned in a callback in the http param? Like Facebook SDK, like Twitter, like Instagram?
problem 3) because of 1), there is no button, no callback execution, the only thing that can be pressed is the X in the OAuth.io view controller
problem 4) the didFailWithOAuthIOError: delegate method gets called with 'user cancelled'.
it seems like something really simple is missing, but everything seems correct up until the "show with provider" call.
please help

When you register your app on Fitbit you should select Application Type "Browser". This will authenticate without the use of a PIN.

Related

Issue for authenticating on parse.com with Twitter

I am trying to use Twitter to authenticate on parse.com in an iOS app.
I have got to the point I have this set in my application:didFinishLaunchingWithOptions: method.
[PFTwitterUtils initializeWithConsumerKey:#"myConsumerKey”
consumerSecret:#"myConsumerSecret”];
When I tap the twitter button it shows a “Loading …” box for a few seconds and then nothing happens.
What I am missing?
I found two details (easy to miss) I needed to modify in the server settings to make things work.
The Callback URL field needs to be filled. It appeareatly doesn’
matter with what as long as it is a well formed URL. Obviously this
was in my case. I presume the content of the URL sometimes matters.
I needed to check “Allow this application to be used to Sign in with
Twitter”

FBSdk Share dialog when FB App is not installed

I've been following Facebook code sample "FBShareSample" to create a share dialog,
The example handles the fallback for user without FB App installed.
Everything is working well with FB App but when I get to the fallback the UI in my app look different from the one in FBDemo (navigation bar, buttons etc.)
In addition the friends button is not active.
Am I missing some kind of configuration in my iOS client? Is it somehting that need to be configured on my App page on FB?
I've used Charles to analyse the request and response and the only difference between FB sample code and my code was the userAgent string.
The problem was resolved by removing from the UserAgent parameter the string: " webView", for some reason this specific string caused FB to return a different layout/CSS page when this parameter was present.

Sharekit is authorizing but not sharing

I know there are a lot of topics on this issue, but I just can't figure out what is wrong.
I want to implement sharekit for Facebook and Twitter, so I followed the install instructions on the github:
Appid is set, got my entry in the cfurlschemes thingy, etc.
I authorize my app:
- (void)authorizeFacebook {
[self.facebook authorize];
}
(self.facebook is a strong member of a share controller singleton).
To share:
- (void)shareFacebook:(SHKItem*)toShare {
[SHKFacebook shareItem:toShare];
}
I also tried:
- (void)shareFacebook:(SHKItem*)toShare {
[self.facebook setItem:toShare];
[self.facebook share];
}
The same constructions are made for twitter.
I can authorize my apps without issue, so my configuration should be fine. When I authorize my app before i call the shareFacebook function, it is authorized but nothing happens with the sharing.
When I don't auhorize before calling shareFacebook (so sharekit detects it is not authorizes and opens authorization first) the'sharekitSendDidFinish' notification is fired but nothing appears on Facebook.
The same goes for Twitter, authorization works but no tweets appear. The SHKItem i'm trying to share is not nil and is filled with the correct stuff I need to share.
*Edit
I'm trying to share an SHKItem with:
Title
Text
Image
I also tried to send an SHKItem with just text, but that didn't work either.
Reinstalling ShareKit did nothing.
Failed with error is not being fired
Senddidfinish is being fired (but only if you authorize via the share function) and has no 'last error'
Solved it, I forgot to set the sharetype... stupid that it doesnt give an error for this :S

iOS phonegap-plugin-facebook-connect vs Facebook iOS Application

I've been trying to make phonegap-plugin-facebook-connect cordova plugin Simple example work, and i've experienced a weired problem.
First I had the Facebook iOS application on my iphone:
On my test application based on the Simple example, when i click the Login button, it just switches to the Facebook iOS app, and switches back to my application.
Clicking the "Me" button gives me an error "an active access token must be used to query information about the current user" which means the login was not successful
Then I removed the Facebook iOS application from my iPhone:
It worked. It opens Safari with Facebook authorisation page, when i click OK it switches back to my application and the auth.login events are successfully fired.
Is this a known issue ? Is there a way to fix it ?
Thank you
I found a workaround:
in Facebook.m
- (void)authorize:(NSArray *)permissions {
self.permissions = permissions;
[self authorizeWithFBAppAuth: NO safariAuth:YES]; //Use Safari Auth instead of FB App
}
With this workaround Facebook iOS authorization will not be used, wheter installed or not.
Github issue#25

Facebook facebook-ios-sdk and graph api is not working

I am using the official facebook ios sdk in my app (https://github.com/facebook/facebook-ios-sdk)
It was all working fine. I was able to log in, pull all my info from Facebook, post things on my wall. Do all those regular stuff that you do...
But since last night, it appears to be broken. When the login window appears and the user logs in, instead of getting the authkey and getting a callback. The login window directs users to facebook.com.
Did anyone else notice the problem? Is there any fix to it or we just assume that the graph API is broken right now and wait?
I assume Facebook were just having a problem. If you had it working & did not change the code then the issue is elsewhere?
In general it's a pain to get working so the following is a brief hint to anyone who is stuck.
Having spent 2 days getting this working I recommend (assuming you have registered an app with Facebook) :
First get the demo app working.
This ensures you have your app ID and worked out how to add the URL stuff into the plist. This is explained in the docs so should not give you much trouble.
Once all the options in the demo app work (login, post, upload a sample photo) you can think about your own app.
Many things are different but you still need to have the AppDelegate method for the URL stuff. Also this method does not work as is assuming your app is using more than one view controller.
I went for the approach of setting up facebook in the app delegate eg:
Facebook *facebook
and in the actual facebook routine referencing that appDelegate's facebook object eg:
appDelegate.facebook
This approach is the subject of quite a few posts on the interweb so you should be able to google it.
I can log on, get info, post & upload photos.
I'm having the same issue, i downloaded the "official example" from gitHub, and wehn compiled it does she#. After i login, it open safari and redirects to http://www.facebook.com/connect/uiserver.php, and the app stalls. Well that's not the way to do it, Facebook. They are obsoleting the old rest api, meanwhile the "new" graph things not working. Im currently using graph API with my own calls to graph.
Check if you have done the following
1.URL scheme corresponding to your Facebook application ID is set. Your URL Schemes must contain item looking like "fb1234567890"
2.AppDelegate's method must be implemented:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
it is described in https://github.com/facebook/facebook-ios-sdk "Authentication and Authorization".
Read also "Single Sign-On".

Resources