01-10-2013 06:23 PM
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->my AchievementsController, 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->achiev ementsController); /* Cleanup Controller */ HandleError(app, rc); return; } if(Global::instance()->getIsInternetAvailable()) { if (SC_LocalAchievementsController_ShouldSynchronize( app->achievementsController) == SC_TRUE) { rc = SC_LocalAchievementsController_Synchronize(app->ac hievementsController); if (rc != SC_OK) { SC_LocalAchievementsController_Release(app->achiev ementsController); /* Cleanup Controller */ HandleError(app, rc); return; } qDebug() << "Synchronizing Achievements..."; } }
Solved! Go to Solution.
01-10-2013 07:08 PM
01-10-2013 08:30 PM