我不明白为什么配置文件总是返回错误:"ProviderNotFoundException".我按照预先编写的集成说明,在github上使用最新版本,用于soomla-cocos2dx-core、cocos2dx-profile和cocos2dx-store。
下面是用cocos2dx v3.5完成的一个示例(在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);应用程序编译成功,但该代码抛出一个MessageBox,名为"ProviderNotFoundException“。
在AppDelegate.cpp中,这里是我从applicationDidFinishLaunching做的init:
#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);你能帮我进一步了解一下侧写吗?
发布于 2015-04-18 18:17:01
这不是一个答案,但你也许可以从这里收集一些东西:http://answers.soom.la/t/resolved-twitter-providernotfoundexception/675/6
在这里:http://answers.soom.la/t/resolved-exception-with-cocos2d-x-profile/1572
发布于 2015-04-21 15:36:35
据我所知,他们使用反射来加载提供者( https://github.com/soomla/ios-profile/blob/9e887f07e0d7f1acb680e02c593a8ce485c93252/SoomlaiOSProfile/ProviderLoader.m#L43)。也许那些类别的人还没上膛呢。
您可以尝试使用"-ObjC“链接器标志,或者类似的东西。
https://stackoverflow.com/questions/29716473
复制相似问题