Using GGGameCentre - how to check if player is logged in?!

Hi,

Bit of a newbie/noob question here i’m afraid, but i’m using GGGameCentre by Glitch Games and I want to check if the player is logged into GC before trying to unlock a GC Achievement. In the READ.ME doc, it mentions this to check if the player is logged in:

local loggedIn = gameCentre:isLoggedIn()

My question is how do i actually use this?! I tried something like:

if loggedIn==true then     --yes, player is logged in so insert code to unlock achievement end

But this doesn’t work. Am I doing something wrong/stupid?

NOTE:

I use Director. In my main.lua, I require in the GGGameCentre module using:

--Require Game Center GGGameCentre = require( "external-GGGameCentre" ) gameCentre = GGGameCentre:new() loggedIn = gameCentre:isLoggedIn()

And i subsequently have a hiscore.lua file, which does the actual checking/unlocking GC achievements. In this file is where I’ve tried to use the if logged in check mentioned above.

What I want to do is to only submit to GC only if the player is logged in.

Any help appreciated!

Thanks