Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sharekit 2, problems with connecting to Facebook after user authentication?

Sharekit opens up Safari to get authentication from the user which is fine (not sure if it should open up Safari or in it's own window). A page then appears saying you have authenticated app.x click ok to continue, once the continue button is tapped it tries to redirect to www.facebook.com/permissions.request but then show an error of:

'Cannot Open Page, Safari cannot open this page because the address is invalid.'

Any ideas what might be going on here, I'm presuming it should be redirecting to my app?!

like image 667
Chris Avatar asked Jan 13 '12 13:01

Chris


1 Answers

Here's my solution to this problem (I am assuming you are using ShareKit 2.0):

I configured ShareKit following the guide they provide ShareKit Configuration Guide. In other words I subclassed the DefaultSHKConfigurator class and added all the necessary configuration there.

In my app delegate I linked the configuration class with ShareKit like this:

DefaultSHKConfigurator *configurator = [[MYSHKConfigurator alloc] init];
[SHKConfiguration sharedInstanceWithConfigurator:configurator];

And removed the configuration info from SHKConfig.h. I don't know why but this worked.

  • note: you could also get away by not subclassing and entering the configuration info directly inside the DefaultSHKConfigurator.m if you are not interested in updating ShareKit;

If you wish the Facebook screen to load inside the app and not in safari you can get inside the Facebook.m file and change the safariAuth: from YES to NO:

[self authorizeWithFBAppAuth:YES safariAuth:NO]; 
like image 74
Alex Stanciu Avatar answered Nov 15 '22 20:11

Alex Stanciu