samedi 18 avril 2015

Coding a simple SHARED Button for Facebook

Which of the 2 ways am I supposed to use to create a simple share button for Facebook in my game app?


1) import Social Framework into project and then put in the following code...



if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

[controller setInitialText:@"High score is %i"];
[self presentViewController:controller animated:YES completion:Nil];
}


2) Add Facebook SDK into your project, get a Facebook App ID by signing up to Facebook's developer program, then add App ID into .plist file, link FBSDKShareKit.framework into project and then use the code provided by Facebook (and there's a LOT of it).


The 1st way of doing it works perfectly fine. Is it a MUST for me to do it the 2nd way? If I do it the first way, would I get in trouble with Facebook or would Apple reject my app? Also, if I do it the first way does it mean I can't use the Facebook "f" logo for the Facebook SHARE button?


Aucun commentaire:

Enregistrer un commentaire