question

Amazon Customer avatar image
Amazon Customer asked

AIR ANE: Callbacks not calling back

Hey - so I've been trying to integrate GameCircle with my Fire TV game, but it's behaving strangely. My first attempt at calling:

com.amazon.nativeextensions.GameCircle.create().addServiceReadyListener(
				function(gameCircleEvent:com.amazon.nativeextensions.events.GameCircleEvent):void {
	trace("Returned");
	
	if (gameCircleEvent.type == com.amazon.nativeextensions.events.GameCircleEvent.SERVICE_READY) {
		trace("Service ready - you can now call other GameCircle functions.");
	} else if (gameCircleEvent.type == com.amazon.nativeextensions.events.GameCircleEvent.SERVICE_NOT_READY ){
		trace("Service start failed:" + gameCircleEvent.errorMessage);
	}
}); 

seemed to work, but returned the error message "cannot initialize." Turns out I had the wrong package name in my profile. Fixed that, and now GameCircle seems to be initializing, in that GameCircle.gameCircle is no longer null, but the callback never happens. I can also call loadLocalPlayer, and the little "welcome" popup shows up correctly, but that callback likewise fails to return. Calling updateAchievementProgress appears to do nothing, however.

Any thoughts as to what's going on?

Thanks.

gamecircle
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Amazon Customer avatar image
Amazon Customer answered
Figured it out... turns out I was calling loadLocalPlayer() before create() had returned, which evidently got GameCircle into a bad state. Oops.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nicole-chen avatar image
nicole-chen answered
Hi, I got the same problem, I did not receive SERVICE_ READY callback even I saw D/[GCircleEx](18765): Flash Event SERVICE_READY={"requestID":"1"} in my log my device: kindle fire HDX (3rd Generation) is running Fire OS 4.5.3 Thanks your help
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nick Gardner avatar image
Nick Gardner answered
Hi, Have you made sure that create() has returned before calling loadlocalplayer()? That has fixed the issue for people before. Thanks, Nick
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nicole-chen avatar image
nicole-chen answered
I can receive callback when I use: GameCircle.create().addEventListener(GameCircleEvent.SERVICE_READY, .... instead of GameCircle.create().addServiceReadyListener(...) Maybe this can help somebody.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.