1

I have a share button with following code:

FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
content.contentURL = [NSURL fileURLWithPath:appFile];
FBSDKShareButton *shareButton = [[FBSDKShareButton alloc] init];
shareButton.shareContent = content;
shareButton.center = CGPointMake(60, 60);

And I see that my share button is greyed out. So I check my access token, which returns null:

NSString *fbAccessToken = [FBSDKAccessToken currentAccessToken].tokenString;
NSLog(@"fbAccessToken %@", fbAccessToken);

According to here, I need to call this first (I have implemented it inside my AppDelegate's - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions:

[[FBSDKApplicationDelegate sharedInstance] application:application
                                          didFinishLaunchingWithOptions:launchOptions]

However, it returns NO, and according to FB's doc:

@abstract Call this method from the [UIApplicationDelegate application:didFinishLaunchingWithOptions:] method of the AppDelegate for your app. It should be invoked for the proper use of the Facebook SDK.

@return YES if the url was intended for the Facebook SDK, NO if not.

I wonder why it returns NO that, perhaps, results my accessToken to be nil. Anyone can give me advise?

UPDATE:

I have logged-in, gained the token, allowed the permissions from my logged-in FB account, but the button is still greyed out.

Community
  • 1
  • 1
Rendy
  • 5,572
  • 15
  • 52
  • 95

1 Answers1

0

For Android people need the native Facebook for Android app installed, version 7.0 or higher

Maybe it's the same thing on iOS.

Nek
  • 73
  • 8