Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers
Accepted Solution

Scoreloop achievements not saving?

Hi, I've been working with scoreloop and the sample code provided by RIM....I have scores (submit and retreive) working. But Achievements/Awards I'm finding a bit weird.

 

Achieved awards are saved to the local bundle and then you're suppose to synchronize them. I'm not getting any errors back from synchronizing so I'm assuming it's working. Local bundle is updated and things are awarded. But nothing shows up in "Games" hub on the alpha dev (score does)

 

However, if I uninstall the app and then re-install, all of the awards are set back to unachieved. Even after things are synchronized again (for example a new award is won and shows up correctly but not any previous won award before the uninstall don't show up).

 

Sounds like things aren't syncing but no error is returned, so could it be a scoreloop issue not saving?

 

What could i be missing? 

 

To load achievements...

	SC_Error_t rc = SC_Client_CreateAchievementsController(app->client, &app->myAchievementsController, LoadAchievementsCompletionCallback, app);
	if (rc != SC_OK) {
		HandleError(app, rc);
		return;
	}

	/* Get the session from the client. */
	SC_Session_h session = SC_Client_GetSession(app->client);

	/* Get the session user from the session. */
	SC_User_h user = SC_Session_GetUser(session);

	//Load achievements for the local awards bundle
	rc =  SC_AchievementsController_LoadAchievements(app->myAchievementsController, user);

 

To retreive them in callback...

SC_AchievementList_h achievementList = SC_AchievementsController_GetAchievements(app->myAchievementsController);

 To sync a new one...

rc = SC_LocalAchievementsController_SetAchievedValueForAwardIdentifier(app->achievementsController, awardIdentifier, &achieved);
		if (rc != SC_OK) {
			SC_LocalAchievementsController_Release(app->achievementsController); /* Cleanup Controller */
			HandleError(app, rc);
			return;
		}

		if(Global::instance()->getIsInternetAvailable()) {
			if (SC_LocalAchievementsController_ShouldSynchronize(app->achievementsController) == SC_TRUE) {
				rc = SC_LocalAchievementsController_Synchronize(app->achievementsController);
				if (rc != SC_OK) {
					SC_LocalAchievementsController_Release(app->achievementsController); /* Cleanup Controller */
					HandleError(app, rc);
					return;
				}
				qDebug() << "Synchronizing Achievements...";
			}
		}

 

 

 

Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Developer
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: Scoreloop achievements not saving?

Found what could be part of the issue.....When I set the award to true, it's callback is never actually called.

SC_Client_CreateLocalAchievementsController(app->client, &app->achievementsController, AchieveAwardCompletionCallback, app);
Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality
Developer
Posts: 96
Registered: ‎10-06-2012
My Device: Z10
My Carrier: Rogers

Re: Scoreloop achievements not saving?

Found the issue...I was releasing the controller too soon

//SC_LocalAchievementsController_Release(app->achievementsController);
Jason I. Carter
Follow me @jasonicarter
Built For BlackBerry - WordsPlus & WordsPlus: Free Edition | word search has never had it so good
www.twocasualcoders.com | never casual on quality