0

The following is my implemented GameCenter Leaderboards code...

GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];

localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
    if (viewController != nil) {

        [self presentViewController:viewController animated:YES completion:nil];

        LBs.hidden=NO;
    }
    else {

     }

    if ([GKLocalPlayer localPlayer].authenticated) {

        GameCenter = YES;
    }
    else {
        GameCenter = NO;
    }
};

The above code is nothing special, it only lets you open up Game Center and check leaderboards. Then when you click on YOUR score and then SHARE button, it sends it to Twitter (for example). The message on Twitter is "Check Out my score on HighScore playing JungleJim".

However, I want a custom message that includes the HighScore number of the player. How do I change that Shared button to include a custom message on Twitter/Facebook accounts. I don't mean for the user to type up the message. I mean for the message to pop up already there with the highscore number.

Do I have to include code in the above code or somewhere else completely?

Jet
  • 555
  • 1
  • 7
  • 19
  • Facebook does not allow you to pre-populate the message part of any share, it has to be a 100% user generated (i.e., typed in by the user). – CBroe Mar 24 '15 at 23:18

1 Answers1

0

I am unfamiliar with game-center-leaderboard, but as for sharing on facebook with the FB iOS SDK, most likely what is implemented in the backend is a share dialog (https://developers.facebook.com/docs/sharing/ios#share_dialog). This as you can see doesn't allow, as CBroe suggested, for pre-populated text in the SDK's UI.

That being said, if there's a way in game-center-leaderboard to override this behavior and share using open graph stories, you could achieve a custom text like: Chris scored a high score using myApp

https://developers.facebook.com/docs/sharing/ios#open_graph

  • Thanks, I'll look into it. Sorry for being off topic but since you're a FaceBook engineer maybe you can tell me if I use Facebook ads in my iOS app, can I use Google's AdMob as the mediation solution? I'm currently using Google's AdMob as a mediation solution for my ads. Or to implement Facebook ads in app, am I only supposed to use Facebook's mediation solution? If I can use Google's AdMob, then I only need the Facebook adapter and to import the Facebook framework into my header/implementation files, right? – Jet Mar 31 '15 at 01:45