Permalink
Browse files

4.0.2 update

  • Loading branch information...
vhbvb committed Sep 22, 2017
1 parent 323e86b commit 20aa42f683658f65c44e4adf79c18a9c0e8dc132
Showing 691 changed files with 11,843 additions and 3,023 deletions.
View
@@ -214,5 +214,5 @@ void AppDelegate::initShareSDKConfig()
// <string>iosv1101</string>
// <key>MOBAppSecret</key>
// <string></string>
cn::sharesdk::C2DXShareSDK::registerAppAndSetPlatformConfig("moba6b6c6d6","b89d2427a3bc7ad1aea1e1e8c1d36bf3",totalDict);
cn::sharesdk::C2DXShareSDK::registerAppAndSetPlatformConfig("8e3320a36606", totalDict);
}
@@ -94,24 +94,23 @@ void releaseMethod(JniMethodInfo &mi) {
mi.env->DeleteLocalRef(mi.classID);
}
bool registerAppAndSetPlatformConfigJNI(const char* appKey,const char* appSecret, C2DXDictionary *platformInfos) {
bool registerAppAndSetPlatformConfigJNI(const char* appKey, C2DXDictionary *platformInfos) {
JniMethodInfo mi;
bool isHave = getMethod(mi, "initSDKAndSetPlatfromConfig", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
bool isHave = getMethod(mi, "initSDKAndSetPlatfromConfig", "(Ljava/lang/String;Ljava/lang/String;)V");
if (!isHave) {
return false;
}
jstring jInfo = NULL;
jstring jAppKey = NULL;
jstring jAppSecret = NULL;
if (platformInfos != NULL) {
CCJSONConverter* json = CCJSONConverter::sharedConverter();
const char* ccInfo = json->strFrom(platformInfos);
jInfo = mi.env->NewStringUTF(ccInfo);
}
jAppKey = mi.env->NewStringUTF(appKey);
jAppSecret = mi.env->NewStringUTF(appSecret);
mi.env->CallStaticVoidMethod(mi.classID, mi.methodID, jAppKey,jAppSecret,jInfo);
mi.env->CallStaticVoidMethod(mi.classID, mi.methodID, jAppKey, jInfo);
releaseMethod(mi);
return true;
}
@@ -43,12 +43,11 @@ bool getMethod(JniMethodInfo &mi, const char *methodName, const char *paramCode)
void releaseMethod(JniMethodInfo &mi);
//jni methods
bool initSDKJNI(const char* appKey,const char* appSecret);
bool initSDKJNI(const char* appKey);
bool setPlatformConfigJNI(int platformId, C2DXDictionary *platConfig);
bool registerAppAndSetPlatformConfigJNI(const char* appKey,const char* appSecret, C2DXDictionary *platformInfos);
bool registerAppAndSetPlatformConfigJNI(const char* appKey, C2DXDictionary *platformInfos);
bool authorizeJNI(int reqID, int platformId, C2DXAuthResultEvent callback);
@@ -69,13 +69,13 @@ const char* PlatId::Any = "999"; /**< 任意平台 */
int reqID = 0;
void C2DXShareSDK::registerAppAndSetPlatformConfig(const char *appKey,const char *appSecret, C2DXDictionary *configInfo)
void C2DXShareSDK::registerAppAndSetPlatformConfig(const char *appKey, C2DXDictionary *configInfo)
{
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
//Andorid
// This is not a necessary method for Android, you can setup your platform configs more efficiently in "assets/ShareSDK.xml"
registerAppAndSetPlatformConfigJNI(appKey,appSecret, configInfo);
registerAppAndSetPlatformConfigJNI(appKey, configInfo);
#elif CC_TARGET_PLATFORM == CC_PLATFORM_IOS
@@ -82,8 +82,8 @@ namespace cn
* @param platType 平台类型
* @param configInfo 配置信息
*/
static void registerAppAndSetPlatformConfig(const char *appKey, C2DXDictionary *configInfo);
static void registerAppAndSetPlatformConfig(const char *appKey,const char *appSecret, C2DXDictionary *configInfo);
/**
* @brief 用户授权
*
@@ -618,18 +618,16 @@ id convertPublishContent(C2DXDictionary *content)
[shareContentPara SSDKEnableUseClientShare];
}
}
//v4.0.1 弃用
// C2DXString *advancedShare = dynamic_cast<C2DXString *>(content -> objectForKey("advanced_share"));
// if (advancedShare)
// {
// BOOL tempAdvancedShare = advancedShare -> boolValue();
// if(tempAdvancedShare)
// {
// [shareContentPara SSDKEnableAdvancedInterfaceShare];
// }
// }
// //v4.0.1 弃用
// C2DXString *advancedShare = dynamic_cast<C2DXString *>(content -> objectForKey("advanced_share"));
// if (advancedShare)
// {
// BOOL tempAdvancedShare = advancedShare -> boolValue();
// if(tempAdvancedShare)
// {
// [shareContentPara SSDKEnableAdvancedInterfaceShare];
// }
// }
//v4.0.1 使用微博api进行分享
C2DXString *apiShare = dynamic_cast<C2DXString *>(content -> objectForKey("api_share"));
if (apiShare)
@@ -481,6 +481,7 @@ void HelloWorld::showShareMenuClickHandler(cocos2d::Ref* pSender)
//iOS 启用微博高级分享接口 3.6.3以后版本支持
content -> setObject(__String::createWithFormat("%d", true), "advanced_share");
C2DXShareSDK::showShareMenu(NULL,content,100,100, shareContentResultHandler);
}
@@ -552,7 +553,6 @@ void HelloWorld::oneKeyShareContentClickHandler(cocos2d::Ref *pSender)
platforms->addObject(sina);
__Integer *tencent = new __Integer(cn::sharesdk::C2DXPlatTypeTencentWeibo);
platforms->addObject(tencent);
//一键分享
C2DXShareSDK::oneKeyShareContent(platforms, content, shareContentResultHandler);
}
@@ -569,8 +569,8 @@ void HelloWorld::showShareViewClickHandler(cocos2d::Ref *pSender)
//iOS 启用客户端分享接口
content -> setObject(__String::createWithFormat("%d", true), "client_share");
// //iOS 启用微博高级分享接口 3.6.3以后版本支持 v4.0.1弃用
// content -> setObject(__String::createWithFormat("%d", true), "advanced_share");
// //iOS 启用微博高级分享接口 3.6.3以后版本支持 v4.0.1弃用
// content -> setObject(__String::createWithFormat("%d", true), "advanced_share");
//iOS 启用微博API接口进行分享
content -> setObject(__String::createWithFormat("%d", true), "api_share");
@@ -596,6 +596,8 @@ void HelloWorld::shareWithConFileBtnClickHandler(cocos2d::Ref *pSender)
C2DXShareSDK::shareWithConfigurationFile("ShareSDK", cn::sharesdk::C2DXPlatTypeQQ, NULL, shareContentResultHandler);
}
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
void HelloWorld::showShareMenuWithConFileBtnClickHandler(cocos2d::Ref *pSender)
{
__Dictionary *customFields = __Dictionary::create();
@@ -611,3 +613,5 @@ void HelloWorld::showShareViewWithConFileBtnClickHandler(cocos2d::Ref *pSender)
C2DXShareSDK::showShareViewWithConfigurationFile(cn::sharesdk::C2DXPlatTypeSinaWeibo, "ShareSDK", customFields, shareContentResultHandler);
}
#endif
@@ -49,10 +49,12 @@ class HelloWorld : public cocos2d::Layer
void shareWithConFileBtnClickHandler(cocos2d::Ref *pSender);
//根据配置文件分享(可选-自定义字段)
void cuntomShareWithConFileBtnClickHandler(cocos2d::Ref *pSender);
void customShareWithConFileBtnClickHandler(cocos2d::Ref *pSender);
//使用分享菜单栏+配置文件分享
void showShareMenuWithConFileBtnClickHandler(cocos2d::Ref *pSender);
//使用分享编辑页面+配置文件分享
void showShareViewWithConFileBtnClickHandler(cocos2d::Ref *pSender);
CREATE_FUNC(HelloWorld);
Oops, something went wrong.

0 comments on commit 20aa42f

Please sign in to comment.