Sharekit - Facebook configuration

8.4k Views Asked by At

I am trying to integrate sharekit in an ios app. Everything works properly but I have problem with Facebook. What I'have done so far :

  1. created an app on Facebook (no extra configuration on Facebook, like native etc..)
  2. edited SHKConfig.h and added
    #define SHKFacebookAppID @"MyFacebookAppID"

  3. in my app.plist added the url scheme : fb+appID
    Now When I try to share something on Facebook, the Facebook app on the device is opened, showing the message : You are logging into this app as "facebookUsername", when I click ok I'm redirected to my app but nothing happen, no sharing action.
    I am missing something??

3

There are 3 best solutions below

3
On BEST ANSWER

The solution to my problem is illustrated here sharekit installation guide step 6

1
On

The SHKConfig.h file seems to indicate that you don't include a literal "+" in your URL scheme. Check the last line of this quote:

// Facebook - https://developers.facebook.com/
// SHKFacebookAppID is the Application ID provided by Facebook
// SHKFacebookLocalAppID is used if you need to differentiate between several iOS apps running against a single Facebook app. Leave it blank unless you are sure of what you are doing. 
// The CFBundleURLSchemes in your App-Info.plist should be "fb" + the concatenation of these two IDs.
// Example: 
//    SHKFacebookAppID = 555
//    SHKFacebookLocalAppID = funk
// 
//    Your CFBundleURLSchemes entry: fb555funk
0
On

Things You have to do for Integrate Sharekit With your Application..(Recommended)

1) Actually You dont need to set URL scheme in .plist file for Sharekit. It's only for facebook API users..

2) Check out,Did you fill api key and secret key in SHKConfig.h file like this below

#define SHKFacebookKey              @"YOUR_API_KEY"
#define SHKFacebookSecret           @"YOUR_APP_SECRET_KEY"

3) Verify Did you "import SHK.h" file..

4) You have to include "MessageUI,SystemConfiguration and Security frameworks".

5) You dont need to do this #define SHKFacebookAppID @"MyFacebookAppID"

6) Invoke sharekit actionsheet as given in documentation.