2

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?

Zenslainer
  • 159
  • 1
  • 9

2 Answers2

1

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

Andrei Bazanov
  • 352
  • 2
  • 11
0

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.

vedi
  • 400
  • 3
  • 17
  • Unfortunatelly, I already use -ObjC in the project. It seems Profile is bundled with ios-profile ".a" files pre-compiled. Maybe these files don't like to be used with the cocos2dx part (something not up-to-datet in them)? – Zenslainer Apr 21 '15 at 18:07
  • you can try to use "sourced" version for your project (see https://github.com/soomla/cocos2dx-profile#working-with-sources) – vedi Apr 21 '15 at 19:45