[DEPRECATED] Various Codea Objective-C Libraries

Oh I’m sorry, English is not my mother tongue, obviously, and I tend to stumble on this kind of things… :slight_smile: thanks again for the heads up on the typo!

Thanks! actually, it’s activated, what would be your other solution @Zoyt?

@Rodolphe. I think I might be able to help. Are you calling the showGameCenter together with authencatePlayer ? Because that might cause that issue.

@Zoyt. Your add ons are really helpful, but I think I’m doing something wrong. The Game Center log in will show up in the simulator, but I can’t log in and see the test leaderboards I have made.

EDIT: Never mind. I just never updated the App ID. :slight_smile:

Thanks @YoloSwag, should I use only either showGameCenter or authencatePlayer ?

But maybe I didn’t update the app id either, where should I do this?

@Rodolphe. I use authencatePlayer at the beginning, and thats it. When you want to show the leaderboards I then would assume you use showGameCenter, but i haven’t tried this.

And you can update your App ID under the certificates page in the member section on the Apple dev website. However, i am still having problems with the logging in part.

EDIT (This contains the answer to your question): This was actually fixed by making a sandbox account. I reset my iPad, and it prompted me to make a new account.

To get rid of that error, try putting authencatePlayer in setup. This will allow the banner to pop up if they’re already signed in, or prompt them to log in if they’re not already. Hope this helps! I’m learning as I go along.

If you have a button that pulls up game center, add this function somewhere within the parameters of that code: showGameCenter(). That will pull up any leaderboards you have.

Sorry for the long explanation.

Still no luck… I’m wondering now, something really obvious I might have overlooked : should I create an app in itunes connect, then a leader board, in order to to be able to connect to it from my app while still in development?

@Rodolphe - Yes, that was one of the other things I was going to suggest. Try that. I think that’s your issue.

@Zoyt. Does showGameCenter automatically call the leaderboard option set up in iTunes Connect, or does the leaderboard ID need to be added?

@Rodolphe, yes you do need to have created the app in itunes connect

@YoloSwag - Not quite sure what you’re asking, but you do have to call authenticatePlayer in the main function. Then, when the user wants to see the leaderboards, you call the showGameCenter function.
Edit: Sorry, I misunderstood your question. You can’t (at this time) pass anything into the function, so it just goes to the default leaderboard.

@Zoyt. When I’m reporting a score to Game Center, am I supposed to put a variable within the parenthesis of reportScore? Because when I do put my scoring variable the app crashes.

Thanks @JakAttak and @Zoyt, I’ll try that… :slight_smile:

@YoloSwag - Make sure you’re also including the GameCenter leaderboard along with the score. i.e.: reportScore(self.score,"highscore")
You can find the leaderboard IDs on iTunesConnect.

@Zoyt, thanks. Now I can see the test scores!

@Zoyt, @JakAttak, first-timer concern here… I’m wondering if I understood you well as far as creating the app in iTunes connect in order to test Game Center capabilities.

When creating the app, Apple asks me about all kind of material and information in order for them to review and publish the app. Off course, I’m not ready to get it reviewed, and much less published for that matter.

How does that work? should I go ahead, and I will later have an option to tell them not to review the app yet?

Cheers!

@Rodolohe, yes it is a slightly annoying system, you have to provide some of the details such as a screenshots - but don’t worry because it will not put it into review yet and you can change all that info later.

Ok, thanks a lot @JakAttak!

Alright, it seems to work in sandbox mode in the simulator! Thanks! Also, is it possible to send achievements to game center, @Zoyt?

@Rodolphe, you would have to add your own functions to add that functionality.

Ok, I’ll pass it for now, Objective C is still a little intimidating to me :slight_smile: I’ll report back here if I manage anything…