samedi 18 avril 2015

soomla : cocos2dx : Profile -> "ProviderNotFoundException" (cocos2d3.x)

I don't understand why Profile always return error : "ProviderNotFoundException". I followed integration instructions, and I use latest versions on github for soomla-cocos2dx-core,cocos2dx-profile and cocos2dx-store.


Here is an example done with cocos2dx v3.5 (same behaviour on 3.4):



soomla::CCError *profileError = nullptr;
bool isLoggedIn = soomla::CCSoomlaProfile::getInstance()->isLoggedIn(soomla::TWITTER, &profileError);
if (profileError)
MessageBox(profileError->getInfo(), "Error");
else
CCLOG("logged in TWITTER: %d",isLoggedIn);


Application compiles successfully but that code throws a MessageBox saying "ProviderNotFoundException".


In AppDelegate.cpp here is the init I do from applicationDidFinishLaunching:



#define NEWSTRING(s) __String::create(s)

SOOMLA_STORE_EVENTS = new TSoomlaStoreEvents(); // My defined store events
PRODUCTSFORSALE = TItemsForSale::create(); //class for buy items
STOREITEMS = __Dictionary::create();

soomla::CCSoomla::initialize(SOOMLA_CUSTOM_SECRET);//"customSecret");
STOREITEMS->setObject(NEWSTRING(SOOMLA_ANDROID_PUBLIC_KEY), "androidPublicKey");
STOREITEMS->setObject(Bool::create(true), "SSV");

soomla::CCSoomlaStore::initialize(PRODUCTSFORSALE, STOREITEMS);

//----- SOOMLA PROFILE

__Dictionary *profileParams = __Dictionary::create();
__Dictionary *twitterParams = __Dictionary::create();
__Dictionary *googleParams = __Dictionary::create();

twitterParams->setObject(NEWSTRING(SOOMLA_TWITTER_CONSUMER_KEY), "consumerKey");
twitterParams->setObject(NEWSTRING(SOOMLA_TWITTER_CONSUMER_SECRET), "consumerSecret");

googleParams->setObject( NEWSTRING(SOOMLA_GOOGLE_CLIENTID), "clientId");

profileParams->setObject(twitterParams, soomla::CCUserProfileUtils::providerEnumToString(soomla::TWITTER)->getCString());
profileParams->setObject(googleParams, soomla::CCUserProfileUtils::providerEnumToString(soomla::GOOGLE)->getCString());

soomla::CCSoomlaProfile::initialize(profileParams);


Can you help me going further with Profile, please?


Aucun commentaire:

Enregistrer un commentaire