merrill
merrill

Reputation: 591

iphone: facebook dialog appear and disappear right away using sharekit

I successfully integrate sharekit into my app. At first, I was able to have the facebook up and running, able to login, and publish it but problem was with the twitter was unable to post "could not authenticate with oauth" so I added the one line in shktwitter.m

// this is the error message for revoked access
        if ([errorMessage isEqualToString:@"Invalid / used nonce"] || [errorMessage isEqualToString:@"Could not authenticate with OAuth."])
        {
                self.pendingAction = SHKPendingShare;
            [self sendDidFailShouldRelogin];
        }

from there I was able to post from twitter with no problem and Now the main reason of this post was that the facebook is now the problem. Everytime I click share of facebook it would open the dialog (all white screen with blue top bar as default facebook style) it would close it right away. I have cleaned the targets, restart the simulator, restart the xcode, everything I can think of to get it working like the first time but still giving me the same result. I only change one line of code(mention above) but Im assuming it wouldn't affect the facebook dialog in anyway since its in diff. class. I have searched around but all the answers i've found doesn't solve my problem. There's no error and build is always successful. I hope to find the answers soon. =)

few Links I've read

https://github.com/ideashower/ShareKit/issues/207

https://github.com/ideashower/ShareKit/issues/234

https://github.com/dagerydoo/ShareKit

UPDATE I added a logout button and was able to logout all the services. I was able to open the login screen of facebook but after login it would do the same problem (dialog with white screen blue bar and disappear after a second) it wont show the publish page.

I also did the way dagerydoo does it where it opens the safari instead of dialog within the app i was able to login and "allow" and the same problem here white screen with error message pop up "safari cannot open the page because the address is invalid" i looked at the address it is "facebook.com/dialog/permissions.request"....im thinking that could be the problem that was causing the white screen both the dialog within the app and in the safari where it would be white screen when requesting to publish page

Upvotes: 2

Views: 1734

Answers (2)

Tyler Daniel
Tyler Daniel

Reputation: 676

I had the same behavior -- ShareKit opens FB for authentication and then FB just goes to the newsfeed or whatever after briefly displaying a white dialog. I believe that in my case I was already logged in and FB was trying to send me back to my app, authenticated. The problem was with the "url scheme" not working correctly and opening my app. I had several versions of my app installed on the device (the current, on-sale version, dev version, etc). All had registered the same url scheme. I had been developing with an "ad-hoc" build configuration separate from the release build config. I haven't fixed the problem with the ad-hoc build, but the release config is working. That's enough for me to start getting work done again, so I'm dropping the issue for now. FWIW.

Upvotes: 0

merrill
merrill

Reputation: 591

Solved! After many attempt of trying to solve it through other peoples method and suggestion and all fail I decided to start over again with the original sharekit and found out that I deleted the common warning "class 'fbxmlhandler' does not implement the 'NSXMLParserDelegate' protocol" which causes that problem. I also added the NSXMLParserDelegate protocol in FBXMLHandler.h which gets rid of the warning, no error, and everything running the way it should be.

Upvotes: 2

Related Questions