Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New FBConnect Enabled ShareKit #238

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

dagerydoo
Copy link

This most recent version also supports local app IDs for multiple iOS apps built around a single facebook app, in addition to fixes that allow an image to get uploaded following.

It seems to be in use by at least several other ShareKit users at this point, and it may be needed sooner rather than later for FB sharing.

+ New fields used by the app delegate for SHKFacebook
+ ShareKitAppDelegate now propagating appropriate incoming URLs
+ Replaced SHKFacebookKey and SHKFacebookSecret with SHKFacebookAppID
+ New version of SHKFacebook based on most recently released FBConnect library
+ Updated project file
+ New fields used by the app delegate for SHKFacebook
+ ShareKitAppDelegate now propagating appropriate incoming URLs
+ Replaced SHKFacebookKey and SHKFacebookSecret with SHKFacebookAppID
+ New version of SHKFacebook based on most recently released FBConnect library
+ Updated project file
+ [Update] Reinstating SHKEvernote.m (generates compile errors)
@tobytaro
Copy link

can it upload image with title?

@dagerydoo
Copy link
Author

I'll look into when I get a chance.

@dougdrury
Copy link

@dagerydoo Great work on this. One question, why does mobile safari want to come up, say I already authenticated and then fail to load the page? Is there some issue with the AppDelegate methods that you have us add? I did all the steps in the new readme, but for the life of me I can't get the facebook login page to pop-up inside the app. Any help would be great!! I see in other threads that some folks had this issue, but did not see a resolution. You were mentioning that you had made an object static and were rethinking that. Did that make it into the master?

The error from Mobile Safari is 'Cannot open location. Address is invalid.' After seeing the 'already authenticated' screen from FBConnect HTML.

My app is a non multi-tasking iPad app. There are no localappids. Only one app id. Do I need to set my facebook apps mobile settings to native?

@dagerydoo
Copy link
Author

@dougdrury — What do you mean by fail to load the page? Are you talking about an error from facebook, or a failure to post to facebook? Without revealing your app ID, or other confidential information, what does you Info.plist entry look like? It sounds like some part of iOS is having trouble kicking back to your app.

The new authentication method that FB seems to be pushing requires the user to switch either to a native facebook app or the website to login and allow your app, using the provided FBConnect, there is no other alternative, unless one were to hack the FBConnect code and force it to use an embedded UIWebView. I haven't looked into that approach for several reasons (time being a very major one, but also the feeling that such a move would draw the ire of FB).

@dougdrury
Copy link

@dagerydoo - Thanks for getting back. Yes, it seems that the authentication is working OK, but the redirect back to my app is failing. I click on the Sharekit button, then facebook and Mobile Safari kicks in showing that my app is already authorized http://cl.ly/7BGF. Then I tap OK and get the following screen on Mobile Safari http://cl.ly/7Bps.

Here is a screen cap of my info.plist with my app id scrubbed. http://cl.ly/7BAa

Thanks for any help.

@dagerydoo
Copy link
Author

Does your app ID really start with the letter 'a'? I was under the impression that the app IDs were all numeric. Either way, it appears that facebook is unable to redirect back to your app, which is likely a configuration problem...

@dougdrury
Copy link

Crap. I was copying from my old shconfig.h file. I just pulled the FB App ID from fb.com and it is just numeric. Thanks!!
I can get the redirect back to my app now, but the modal dialog does not come back up to allow the user to share on FB after the redirect back to my app. In other words, in my app I click on my share button, mobile Safari comes up, shows the http://www.cl.ly/7BGF screen and after I hit Okay, it takes me back to the app, but no share window comes up to type on my wall. What class is handling that part? I can look and make sure that I have it right in my code. Thanks again for your help!!

@dagerydoo
Copy link
Author

It should continue with the post immediately after the user authenticates. Can you verify that the item you are posting does not show up on your wall?

@dagerydoo
Copy link
Author

Also, I meant to mention: the user will not be presented with another dialog box, but the ShareKit "saving..." dialog box should pop up, and then the "saved" checkbox after the item is posted.

@dougdrury
Copy link

Yup. It does not get posted to my wall. I don't get the dialog that allows me to edit the post before sharing (like the old version) or the 'saving...' dialog or saved checkbox. How is Sharekit getting notified when FBConnect returns back to the app? What class method is hit when the app gets the return from FB?

@dagerydoo
Copy link
Author

It comes back in via the AppDelegate, in one of the following two methods:


- (BOOL)application:(UIApplication *)application 
            openURL:(NSURL *)url 
  sourceApplication:(NSString *)sourceApplication 
         annotation:(id)annotation 
{
  return [SHKFacebook handleOpenURL:url];
}

- (BOOL)application:(UIApplication *)application 
      handleOpenURL:(NSURL *)url 
{
  return [SHKFacebook handleOpenURL:url];
}

Try sticking a breakpoint or a log message in those two methods and see if they actually execute...

@dougdrury
Copy link

@dagerydoo - OK. I changed my app to allow multi-tasking (Application does not run in background==NO) and the dialog comes up after the FBConnect page goes away and all works as it should. So, I think the issue was the multi-tasking off. I don't really want Multi-Tasking on this app. Any thoughts? Last question!! I swear!!

@dagerydoo
Copy link
Author

No problem — the goal is to have the code work, and now I have something to work with...

It turns out that you are quite correct -- when an app that was terminated is relaunched via a URL call, it seems to be ignoring the URL. I suspect that this is an order of operations bug, but a couple quick stabs were fruitless, and it is a bit of a pain to debug (since the debugger quits when Safari opens). I won't have time for several hours to look at this, but I'll see if I can figure it out later this evening...

@dougdrury
Copy link

I appreciate the work you are doing on this. I will await your genius coding!! :-)

@tobytaro
Copy link

@dagerydoo Do you solve the issue that it shares photo with no title?

…gate (typically indicative of a non-multitasking process that required authorization)
@dagerydoo
Copy link
Author

@dougdrury — Didn't have a chance last night to work on this, but could you try the latest version (https://github.com/dagerydoo/ShareKit) and confirm it for me?

@tobytaro — I am most certain that it is working now — can you check out the latest version and verify the behavior?

@dougdrury
Copy link

@dagerydoo - I loaded up the new code. I turned multi-tasking back off and tested. The new master seems to work well. When the app comes back from FBConnect the share window pops up with the content. Great work!!

…e previous implementation was causing some compiler errors. It should only be defined if you have use for it...
@tobytaro
Copy link

tobytaro commented Jun 1, 2011

@dagerydoo Thank you! I use your new FBConnect. It works well now.

@steve21124
Copy link

Is this FBConnect enable getting friend list?

@dagerydoo
Copy link
Author

@steve21124 — that is outside of the scope of ShareKit, which is meant to provide a simple interface to post to a variety of sites. Facebook does provide a well documented, easy to use API that facilitates retrieval of all kinds of data, including friend lists, so I would recommend starting there:

https://developers.facebook.com/docs/reference/api/

@CintoA
Copy link

CintoA commented Jun 29, 2011

Hi,

I have updated to this new version of the sharekit about 4 weeks ago.

That was due to the fact that my apps were no longer working with the old version. After the update everything worked fine - until now.

I cannot post anything to Facebook as the edit box within with post windows does not appear. Can anybody else confirm this and do you have any ideas for that?

Thanks and best regards

@dagerydoo
Copy link
Author

@CintoA — I am seeing that, as well. How long have you noticed this happening? If it is just this morning, it may be that FB themselves have a problem — that view is basically a UIWebView, served up from FB.

@miakacham
Copy link

@dagerydoo, thanks for the brilliant work. but I would like to confirm, is this version using already the OAuth 2.0 that will be used starting october 2011? Thanks! :)

@holah-reiken
Copy link

Iam researching a similar problem,and perhaps one of you can shed some light on it. The app I am working on, which I did not originally write, uses Sharekit to send items to Facebook, Twitter or Email. Twitter and email work, but when I login to Facebook, I get returned to the login screen with the message: "To use Facebook, please select your Settings app -> Safari -> Accept Cookies -> From visited". As it happens I already have that configured for Safari, and I am not trying to bring it up in Safari. Do I need something analogous in my app, or is this related to some of the posting problems you've been discussing here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants