Reputation: 159
I don't understand why Profile always return error : "ProviderNotFoundException". I followed pre-comipiled 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?
Upvotes: 2
Views: 248
Reputation: 400
As I understand they use reflection in order to load providers ( https://github.com/soomla/ios-profile/blob/9e887f07e0d7f1acb680e02c593a8ce485c93252/SoomlaiOSProfile/ProviderLoader.m#L43). Maybe those classed just have not been loaded.
You can try to use "-ObjC" linker flag, or something like that.
Upvotes: 0
Reputation: 352
this is not an answer, but you might be able to glean something from here: http://answers.soom.la/t/resolved-twitter-providernotfoundexception/675/6
and here: http://answers.soom.la/t/resolved-exception-with-cocos2d-x-profile/1572
Upvotes: 1