我不明白为什么配置文件总是返回错误:“ProviderNotFoundException”。我遵循预编译的集成指令,我在github上为soomla-cocos2dx-core,cocos2dx-profile和cocos2dx-store使用最新版本。soomla:cocos2dx:Profile - >“ProviderNotFoundException”(cocos2d3.x)
这里是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);
应用程序编译成功,但该代码抛出一个消息说:“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);
你能帮我档案进一步去,好吗?
不幸的是没有具体的解决方法,无论如何谢谢 – Zenslainer
我会给你的烦恼带来Soomla家伙的注意。也许其中一个可以帮助。 – cocojiambo
好的,谢谢 – Zenslainer