Sharekit is authorizing but not sharing - ios

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

Related

Using OAuth.io iOS library to log into FitBit snag

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.

Twitter login without social framework

I am trying to implement twitter login in my ios app. I do not want to use social frame work. I have tried all ways to twitter login but unfortunately this not working. Mainly i am facing the callback url issue in it. Can you please guys help me.
I have tried this url as well
http://codegerms.com/login-with-twitter-example-with-ios-tutorial-using-oauth/
but mainly i am facing the callback issue. Can any one please suggest other plugin.
To get the user's information from Twitter, you can use OAuth.io's iOS SDK:
https://github.com/oauth-io/oauth-ios
After having created an account on https://oauth.io, and added Twitter as a provider, you'll be able to get the user's info quite easily. You just need to follow these steps:
1 Install the framework through Cocoa Pods, or manually
Via Cocoa pod:
$ pod install "OAuth.io"
Manually:
Just get the OAuthiOS.framework file here and install it like any other framework.
2 Insert the header reference
Add #import <OAuthiOS/OAuthiOS.h> in your ViewController.
3 Set the view controller as delegate to OAuthIODelegate:
#interface MyViewController : UIViewController<OAuthIODelegate>
//[...]
#end
4 Initialize and launch an authentication popup in the ViewController:
OAuthIOModal *oauthioModal = [[OAuthIOModal alloc] initWithKey:#"your_app_public_key" delegate:self];
[oauthioModal showWithProvider:#"twitter"];
5 Implement the following delegate method to get a Request Object, that lets you retrieve the user's information, thanks to the me method:
- (void)didReceiveOAuthIOResponse:(OAuthIORequest *)request
{
[_request me:nil success:^(NSDictionary *output, NSString *body, NSHTTPURLResponse
*httpResponse)
{
NSLog(#"name: %#", [output objectForKey:#"name"]);
}];
}
To get more information about the iOS SDK, feel free to check out the guide here:
https://oauth.io/getting-started?ios&None
You can also follow a git based tutorial here:
https://oauth.io/docs/tutorials/client/ios
And find the reference documentation of the SDK here:
https://oauth.io/docs/api-reference/client/ios
Note that OAuth.io also open sourced their core in the oauthd project (check out the repo here: https://github.com/oauth-io/oauthd)
Hope this helps :)
rmaddy can you exlain in detail what problem you are facing , I have also followed this tutorial and successfully, I am getting the access token, Try to put breakpoint in your code, You might haven't changed the callback URL in the code, Let me explain you a little using an image
First you should put a break point here in the following function
(BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
Now run application and enter your login credentials in, After you have successfully got the request token then you will be redirected to your redirect URL and then you will get the access token
You program must be not entering in this if condition, try changing this code, to yours callback string, If still you have problem, Let me know in details, I will help you to solve this

iOS FB SDK Incoming URL for apprequests is missing ref=notif, request_ids, app_request_type

I am using iOS FB SDK (baked in Parse F/W) to send app request invites using
[facebook dialog:#"apprequests" andParams:params andDelegate:nil];]
The requests are being sent correctly and also appear on the invitee's account.
When I click on the request, the Facebook app correctly starts my app.
At this point, I am checking for incoming URL to process and get request_ids etc.
The sample code on FB (http://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/) says the incoming URL should be of following format
fb480369938658210://authorize&expires_in=3600&access_token=xyz&target_url=http://m.facebook.com/apps/friendsmashsample?fb_source=notification&request_ids=abc&ref=notif&app_request_type=Duser_to_user
However, I am receiving it like this
fb123456789123456://authorize?expires_in=86400&access_token=BAADiMgKGSZB8BAD3ZCeZAGNkm7d8tGuNZAKuq5nThbNTdiZA1ZBFcp1bhIKp1cFvwDsOPZCZBIgowSwRkBnZARF5tBsyWHk0yLukZAK8ubNZA4ZCbkyQg619cg9v0SMqsaBzgwNbQZCdPZBSLoYwZDZD&
target_url=http%3A%2F%2Fwww.facebook.com%2Fappcenter%2F123456789123456
So there are missing components here like request_ids, ref=notif etc.
Does anything obvious looks to be missing here?
Please help.
Thanks.
For future users, I had to set up the Mobile Site URL as per this bug filed with Facebook - https://developers.facebook.com/bugs/465760136778889/
Ridiculous, but it works. Hope this is resolved. Not sure why they have this dependency.

iOS 6 SLComposeViewController - creating a facebook post with text and URL - no image

Quite simply unable to make a post with just the text and NSURL object. I can do it with just the post, or with the post, NSURL and image, but ideally I'd just like to provide the link with the post.
It simply states "Cannot post to Facebook" as "The post cannot be sent because the connection to Facebook failed."
Is there anything I can do? I'm not using the Facebook SDK at the moment, but perhaps I might have to?
Many thanks
We just started running in to this issue with code that was working correctly yesterday. Googling shows a lot of people having this issue sharing from other Apple apps today via native integration. I actually think this is an issue on Facebook's end.
I tried sharing a URL from Mobile Safari and it too fails with the same error. Can you confirm that Mobile Safari also fails to share?
Well for now I'm able to leave the image part nil (still include the method, just leave the argument nil) and it will show the text and link only.

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