strip anysdk from template.add anysdk by copy way
|
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 463 B After Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">HelloJavascript</string>
|
||||
</resources>
|
||||
@@ -10,6 +10,22 @@
|
||||
"include": [
|
||||
"*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/",
|
||||
"to":"",
|
||||
"include": [
|
||||
".cocos-package.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/js-bindings/",
|
||||
"to":"frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"*.h",
|
||||
"*.cpp",
|
||||
"*.hpp"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -43,10 +59,10 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/js-bindings/",
|
||||
"to":"frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"*"
|
||||
"from":"extensions/anysdk/platform/android",
|
||||
"to":"frameworks/runtime-src/proj.android",
|
||||
"exclude": [
|
||||
"res/mipmap"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1,226 +0,0 @@
|
||||
anysdk.agentManager = anysdk.AgentManager.getInstance();
|
||||
|
||||
anysdk.callWrapper = function(plugin, func){
|
||||
plugin[func.name] = (function(){
|
||||
var params = [];
|
||||
if(arguments){
|
||||
var l = arguments.length;
|
||||
for (var i = 0; i < l; i++) {
|
||||
var arg = arguments[i];
|
||||
var param = anysdk.PluginParam.create(arg);
|
||||
params.push(param);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.returnType == "void"){
|
||||
plugin.callFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "boolean"){
|
||||
return plugin.callBoolFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "int"){
|
||||
return plugin.callIntFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "float"){
|
||||
return plugin.callFloatFuncWithParam(this.name, params);
|
||||
}else {
|
||||
return plugin.callStringFuncWithParam(this.name, params);
|
||||
}
|
||||
}).bind(func);
|
||||
}
|
||||
|
||||
anysdk.parseData = function(data){
|
||||
var jsonData = [];
|
||||
var substring = data.substring(1, data.length - 2)
|
||||
var array = substring.split(",");
|
||||
for (var i = 0; i < array.length; i++ ){
|
||||
var functionData = array[i].split("&");
|
||||
var funcParam = {};
|
||||
for(var j = 0; j < functionData.length; j++){
|
||||
var itemData = functionData[j].split("=");
|
||||
if(itemData.length > 1)
|
||||
{
|
||||
funcParam[itemData[0]] = itemData[1];
|
||||
}
|
||||
}
|
||||
jsonData.push(funcParam)
|
||||
|
||||
}
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
anysdk.registerAPIs = function(plugin) {
|
||||
var functionString = anysdk.JSBRelation.getMethodsOfPlugin(plugin);
|
||||
var data = anysdk.parseData(functionString);
|
||||
for (var i = 0; i < data.length; i++ ){
|
||||
var name = data[i].name;
|
||||
if(name && !plugin[name]){
|
||||
cc.log("plugin: " + name + " auto binding");
|
||||
anysdk.callWrapper(plugin, data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
anysdk.agentManager._loadAllPlugins = anysdk.agentManager.loadAllPlugins;
|
||||
anysdk.agentManager.loadAllPlugins = function (callback, target) {
|
||||
anysdk.agentManager._loadAllPlugins();
|
||||
if(callback){
|
||||
if (target){
|
||||
callback.call(target, 0, "loadAllPlugins finish");
|
||||
}else{
|
||||
callback(0, "loadAllPlugins finish");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anysdk.agentManager._getUserPlugin = anysdk.agentManager.getUserPlugin;
|
||||
anysdk.agentManager.getUserPlugin = function () {
|
||||
var plugin = this._getUserPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
plugin.setListener = function(callback, target){
|
||||
var onUserResult = function(plugin, code, msg){
|
||||
if (target){
|
||||
callback.call(target, code, msg);
|
||||
}else{
|
||||
callback(code, msg);
|
||||
}
|
||||
}
|
||||
plugin.setActionListener(onUserResult,this);
|
||||
};
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getIAPPlugin = anysdk.agentManager.getIAPPlugin;
|
||||
anysdk.agentManager.getIAPPlugins = function () {
|
||||
var plugins = this._getIAPPlugin();
|
||||
if (plugins) {
|
||||
for (var item in plugins){
|
||||
if (plugins.hasOwnProperty(item)){
|
||||
var plugin = plugins[item];
|
||||
if (!plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
return plugins;
|
||||
}
|
||||
|
||||
anysdk.agentManager.getIAPPlugin = function () {
|
||||
var iapPlugins = anysdk.agentManager.getIAPPlugins();
|
||||
if(iapPlugins != null){
|
||||
for(var item in iapPlugins){
|
||||
if (iapPlugins.hasOwnProperty(item)) {
|
||||
return iapPlugins[item];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
anysdk.agentManager._getAdsPlugin = anysdk.agentManager.getAdsPlugin;
|
||||
anysdk.agentManager.getAdsPlugin = function () {
|
||||
var plugin = this._getAdsPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setAdsListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getSocialPlugin = anysdk.agentManager.getSocialPlugin;
|
||||
anysdk.agentManager.getSocialPlugin = function () {
|
||||
var plugin = this._getSocialPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getSharePlugin = anysdk.agentManager.getSharePlugin;
|
||||
anysdk.agentManager.getSharePlugin = function () {
|
||||
var plugin = this._getSharePlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getPushPlugin = anysdk.agentManager.getPushPlugin;
|
||||
anysdk.agentManager.getPushPlugin = function () {
|
||||
var plugin = this._getPushPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setActionListener;
|
||||
plugin.isInitialized = true;
|
||||
plugin.setListener = function(callback, target){
|
||||
var onPushResult = function(plugin, code, msg){
|
||||
if (target){
|
||||
callback.call(target, code, msg);
|
||||
}else{
|
||||
callback(code, msg);
|
||||
}
|
||||
}
|
||||
plugin.setActionListener(onPushResult,this);
|
||||
};
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getAnalyticsPlugin = anysdk.agentManager.getAnalyticsPlugin;
|
||||
anysdk.agentManager.getAnalyticsPlugin = function () {
|
||||
var plugin = this._getAnalyticsPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getRECPlugin = anysdk.agentManager.getRECPlugin;
|
||||
anysdk.agentManager.getRECPlugin = function () {
|
||||
var plugin = this._getRECPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getCustomPlugin = anysdk.agentManager.getCustomPlugin;
|
||||
anysdk.agentManager.getCustomPlugin = function () {
|
||||
var plugin = this._getCustomPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getCrashPlugin = anysdk.agentManager.getCrashPlugin;
|
||||
anysdk.agentManager.getCrashPlugin = function () {
|
||||
var plugin = this._getCrashPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getAdTrackingPlugin = anysdk.agentManager.getAdTrackingPlugin;
|
||||
anysdk.agentManager.getAdTrackingPlugin = function () {
|
||||
var plugin = this._getAdTrackingPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
@@ -1,403 +0,0 @@
|
||||
//for plugin type
|
||||
anysdk.PluginType = {
|
||||
kPluginAds:16,/**< enum value is the type of Ads. */
|
||||
kPluginAnalytics:1,/**< enum value is the type of Analytics. */
|
||||
kPluginIAP:8,/**< enum value is the type of IAP. */
|
||||
kPluginShare:2,/**< enum value is the type of Share. */
|
||||
kPluginUser:32,/**< enum value is the type of User. */
|
||||
kPluginSocial:4,/**< enum value is the type of Social. */
|
||||
kPluginPush:64,/**< enum value is the type of Push. */
|
||||
kPluginCrash:128,/**< enum value is the type of Crash. */
|
||||
kPluginCustom:256,/**< enum value is the type of Custom. */
|
||||
kPluginREC:512,/**< enum value is the type of REC. */
|
||||
kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
|
||||
|
||||
}; //plugin type
|
||||
|
||||
//for Custom
|
||||
anysdk.CustomResultCode = {
|
||||
kCustomExtension:80000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
anysdk.RECResultCode = {
|
||||
kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
|
||||
kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
|
||||
kRECStartRecording:2,/**< enum value is callback of starting to record. */
|
||||
kRECStopRecording:3,/**< enum value is callback of stoping to record. */
|
||||
kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
|
||||
kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
|
||||
kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
|
||||
kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
|
||||
kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
|
||||
kRECShareFail:9,/**< enum value is callback of failing to share. */
|
||||
kRECExtension:90000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
//for ads
|
||||
anysdk.AdsResultCode = {
|
||||
kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
|
||||
kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
|
||||
kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
|
||||
kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
|
||||
kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
|
||||
kNetworkError:5, /**< enum the callback of Network error at center. */
|
||||
kUnknownError:6, /**< enum the callback of Unknown error. */
|
||||
kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
|
||||
kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
|
||||
kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
|
||||
kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
|
||||
kAdsExtension :40000 /**< enum value is extension code . */
|
||||
}; //ads result code
|
||||
|
||||
anysdk.AdsPos = {
|
||||
kPosCenter:0, /**< enum the toolbar is at center. */
|
||||
kPosTop:1, /**< enum the toolbar is at top. */
|
||||
kPosTopLeft:2, /**< enum the toolbar is at topleft. */
|
||||
kPosTopRight:3, /**< enum the toolbar is at topright. */
|
||||
kPosBottom:4, /**< enum the toolbar is at bottom. */
|
||||
kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
}; //ads pos
|
||||
|
||||
anysdk.AdsType = {
|
||||
AD_TYPE_BANNER:0, /**< enum value is banner ads . */
|
||||
AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
|
||||
AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
|
||||
AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
|
||||
AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
|
||||
AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
|
||||
AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
|
||||
}; //ads type
|
||||
|
||||
//for pay result code
|
||||
anysdk.PayResultCode = {
|
||||
kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
|
||||
kPayFail:1, /**< enum value is callback of failing to pay . */
|
||||
kPayCancel:2, /**< enum value is callback of canceling to pay . */
|
||||
kPayNetworkError:3, /**< enum value is callback of network error . */
|
||||
kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
|
||||
kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
|
||||
kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
|
||||
kPayNowPaying:7, /**< enum value is callback of paying now . */
|
||||
kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
|
||||
kPayExtension : 30000, /**< enum value is extension code . */
|
||||
kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
|
||||
};
|
||||
|
||||
anysdk.RequestResultCode = {
|
||||
kRequestSuccess:31000, /**<enum value is callback of succeeding in paying . */
|
||||
kRequestFail:31001 /**<enum value is callback of failing to pay . */
|
||||
};
|
||||
|
||||
// for push action result code
|
||||
anysdk.PushActionResultCode = {
|
||||
kPushReceiveMessage:0, /**value is callback of Receiving Message . */
|
||||
kPushExtensionCode : 60000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
// for share result code
|
||||
anysdk.ShareResultCode = {
|
||||
kShareSuccess:0, /**< enum value is callback of failing to sharing . */
|
||||
kShareFail:1, /**< enum value is callback of failing to share . */
|
||||
kShareCancel:2, /**< enum value is callback of canceling to share . */
|
||||
kShareNetworkError:3, /**< enum value is callback of network error . */
|
||||
kShareExtension :10000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
//for social ret code
|
||||
anysdk.SocialRetCode = {
|
||||
// code for leaderboard feature
|
||||
kScoreSubmitSucceed:1, /**< enum value is callback of succeeding in submiting. */
|
||||
kScoreSubmitfail:2, /**< enum value is callback of failing to submit . */
|
||||
// code for achievement feature
|
||||
kAchUnlockSucceed:3, /**< enum value is callback of succeeding in unlocking. */
|
||||
kAchUnlockFail:4, /**< enum value is callback of failing to unlock. */
|
||||
kSocialSignInSucceed:5, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignInFail:6, /**< enum value is callback of failing to login. */
|
||||
kSocialSignOutSucceed:7, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignOutFail:8, /**< enum value is callback of failing to login. */
|
||||
kSocialGetGameFriends:9, /**< enum value is callback of failing to login. */
|
||||
kSocialExtensionCode :20000, /**< enum value is extension code . */
|
||||
kSocialGetFriendsInfoSuccess: 21001, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kSocialGetFriendsInfoFail: 21002, /**< enum value is callback of failing in getting user info. */
|
||||
kSocialAlreadySubscription: 21003, /**< enum value is callback of subscription . */
|
||||
kSocialNoSubscription: 21004, /**< enum value is callback No subscription. */
|
||||
kSocialSubscriptionFail: 21005, /**< enum value is callback of failing in subscription . */
|
||||
};
|
||||
|
||||
// for user action result code
|
||||
anysdk.UserActionResultCode = {
|
||||
kInitSuccess:0, /**< enum value is callback of succeeding in initing sdk. */
|
||||
kInitFail:1, /**< enum value is callback of failing to init sdk. */
|
||||
kLoginSuccess:2, /**< enum value is callback of succeeding in login.*/
|
||||
kLoginNetworkError:3, /**< enum value is callback of network error*/
|
||||
kLoginNoNeed:4, /**< enum value is callback of no need login.*/
|
||||
kLoginFail:5, /**< enum value is callback of failing to login. */
|
||||
kLoginCancel:6, /**< enum value is callback of canceling to login. */
|
||||
kLogoutSuccess:7, /**< enum value is callback of succeeding in logout. */
|
||||
kLogoutFail:8, /**< enum value is callback of failing to logout. */
|
||||
kPlatformEnter:9, /**< enum value is callback after enter platform. */
|
||||
kPlatformBack:10, /**< enum value is callback after exit antiAddiction. */
|
||||
kPausePage:11, /**< enum value is callback after exit pause page. */
|
||||
kExitPage:12, /**< enum value is callback after exit exit page. */
|
||||
kAntiAddictionQuery:13, /**< enum value is callback after querying antiAddiction. */
|
||||
kRealNameRegister:14, /**< enum value is callback after registering realname. */
|
||||
kAccountSwitchSuccess:15, /**< enum alue is callback of succeeding in switching account. */
|
||||
kAccountSwitchFail:16, /**< enum value is callback of failing to switch account. */
|
||||
kOpenShop:17 , /**< enum value is callback of open the shop. */
|
||||
kAccountSwitchCancel:18,/**< enum value is callback of canceling to switch account. */
|
||||
kUserExtension: 50000, /**< enum value is extension code . */
|
||||
kSendToDesktopSuccess: 51001, /**< enum value is callback of succeeding in sending to desktop. */
|
||||
kSendToDesktopFail: 51002, /**< enum value is callback of failing in sending to desktop. */
|
||||
kGetAvailableLoginTypeSuccess: 51003,/**< enum value is callback of succeeding in getting available login type. */
|
||||
kGetAvailableLoginTypeFail: 51004 ,/**< enum value is callback of failing in getting available login type. */
|
||||
kGetUserInfoSuccess: 51005, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kGetUserInfoFail: 51006 ,/**< enum value is callback of failing in getting user info. */
|
||||
kOpenBBSSuccess: 51007, /**< enum value is callback of succeeding in opening BBS.*/
|
||||
kOpenBBSFail: 51008 /**< enum value is callback of failing in opening BBS. */
|
||||
|
||||
};
|
||||
|
||||
//for toolBar place
|
||||
anysdk.ToolBarPlace = {
|
||||
kToolBarTopLeft:1, /**< enum the toolbar is at topleft. */
|
||||
kToolBarTopRight:2, /**< enum the toolbar is at topright. */
|
||||
kToolBarMidLeft:3, /**< enum the toolbar is at midleft. */
|
||||
kToolBarMidRight:4, /**< enum the toolbar is at midright. */
|
||||
kToolBarBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kToolBarBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
};
|
||||
|
||||
|
||||
//for analytics
|
||||
anysdk.AccountType = {
|
||||
ANONYMOUS:0,/**< enum value is anonymous typek. */
|
||||
REGISTED:1,/**< enum value is registed type. */
|
||||
SINA_WEIBO:2,/**< enum value is sineweibo type. */
|
||||
TENCENT_WEIBO:3,/**< enum value is tecentweibo type */
|
||||
QQ:4,/**< enum value is qq type */
|
||||
ND91:5/**< enum value is nd91 type. */
|
||||
};
|
||||
|
||||
anysdk.AccountOperate = {
|
||||
LOGIN:0,/**< enum value is the login operate. */
|
||||
LOGOUT:1,/**< enum value is the logout operate. */
|
||||
REGISTER:2/**< enum value is the register operate. */
|
||||
};
|
||||
|
||||
anysdk.AccountGender = {
|
||||
MALE:0,/**< enum value is male. */
|
||||
FEMALE:1,/**< enum value is female. */
|
||||
UNKNOWN:2/**< enum value is unknow. */
|
||||
};
|
||||
|
||||
anysdk.TaskType = {
|
||||
GUIDE_LINE:0,/**< enum value is the guideline type.. */
|
||||
MAIN_LINE:1,/**< enum value is the mainline type.. */
|
||||
BRANCH_LINE:2,/**<enum value is the branchline type.. */
|
||||
DAILY:3,/**< enum value is the daily type.. */
|
||||
ACTIVITY:4,/**< enum value is the activity type. */
|
||||
OTHER:5/**< enum value is other type. */
|
||||
};
|
||||
//end analytics
|
||||
|
||||
//for plugin type
|
||||
var PluginType = {
|
||||
kPluginAds:16,/**< enum value is the type of Ads. */
|
||||
kPluginAnalytics:1,/**< enum value is the type of Analytics. */
|
||||
kPluginIAP:8,/**< enum value is the type of IAP. */
|
||||
kPluginShare:2,/**< enum value is the type of Share. */
|
||||
kPluginUser:32,/**< enum value is the type of User. */
|
||||
kPluginSocial:4,/**< enum value is the type of Social. */
|
||||
kPluginPush:64,/**< enum value is the type of Push. */
|
||||
kPluginCrash:128,/**< enum value is the type of Crash. */
|
||||
kPluginCustom:256,/**< enum value is the type of Custom. */
|
||||
kPluginREC:512,/**< enum value is the type of REC. */
|
||||
kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
|
||||
}; //plugin type
|
||||
|
||||
//for Custom
|
||||
var CustomResultCode = {
|
||||
kCustomExtension:80000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
var RECResultCode = {
|
||||
kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
|
||||
kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
|
||||
kRECStartRecording:2,/**< enum value is callback of starting to record. */
|
||||
kRECStopRecording:3,/**< enum value is callback of stoping to record. */
|
||||
kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
|
||||
kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
|
||||
kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
|
||||
kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
|
||||
kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
|
||||
kRECShareFail:9,/**< enum value is callback of failing to share. */
|
||||
kRECExtension:90000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
//for ads
|
||||
var AdsResultCode = {
|
||||
kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
|
||||
kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
|
||||
kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
|
||||
kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
|
||||
kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
|
||||
kNetworkError:5, /**< enum the callback of Network error at center. */
|
||||
kUnknownError:6, /**< enum the callback of Unknown error. */
|
||||
kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
|
||||
kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
|
||||
kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
|
||||
kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
|
||||
kAdsExtension :40000 /**< enum value is extension code . */
|
||||
}; //ads result code
|
||||
|
||||
var AdsPos = {
|
||||
kPosCenter:0, /**< enum the toolbar is at center. */
|
||||
kPosTop:1, /**< enum the toolbar is at top. */
|
||||
kPosTopLeft:2, /**< enum the toolbar is at topleft. */
|
||||
kPosTopRight:3, /**< enum the toolbar is at topright. */
|
||||
kPosBottom:4, /**< enum the toolbar is at bottom. */
|
||||
kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
}; //ads pos
|
||||
|
||||
var AdsType = {
|
||||
AD_TYPE_BANNER:0, /**< enum value is banner ads . */
|
||||
AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
|
||||
AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
|
||||
AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
|
||||
AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
|
||||
AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
|
||||
AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
|
||||
}; //ads type
|
||||
|
||||
//for pay result code
|
||||
var PayResultCode = {
|
||||
kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
|
||||
kPayFail:1, /**< enum value is callback of failing to pay . */
|
||||
kPayCancel:2, /**< enum value is callback of canceling to pay . */
|
||||
kPayNetworkError:3, /**< enum value is callback of network error . */
|
||||
kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
|
||||
kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
|
||||
kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
|
||||
kPayNowPaying:7, /**< enum value is callback of paying now . */
|
||||
kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
|
||||
kPayExtension : 30000, /**< enum value is extension code . */
|
||||
kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
|
||||
};
|
||||
|
||||
var RequestResultCode = {
|
||||
kRequestSuccess:31000, /**<enum value is callback of succeeding in paying . */
|
||||
kRequestFail:31001 /**<enum value is callback of failing to pay . */
|
||||
};
|
||||
|
||||
// for push action result code
|
||||
var PushActionResultCode = {
|
||||
kPushReceiveMessage:0, /**value is callback of Receiving Message . */
|
||||
kPushExtensionCode : 60000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
// for share result code
|
||||
var ShareResultCode = {
|
||||
kShareSuccess:0, /**< enum value is callback of failing to sharing . */
|
||||
kShareFail:1, /**< enum value is callback of failing to share . */
|
||||
kShareCancel:2, /**< enum value is callback of canceling to share . */
|
||||
kShareNetworkError:3, /**< enum value is callback of network error . */
|
||||
kShareExtension :10000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
//for social ret code
|
||||
var SocialRetCode = {
|
||||
// code for leaderboard feature
|
||||
kScoreSubmitSucceed:1, /**< enum value is callback of succeeding in submiting. */
|
||||
kScoreSubmitfail:2, /**< enum value is callback of failing to submit . */
|
||||
// code for achievement feature
|
||||
kAchUnlockSucceed:3, /**< enum value is callback of succeeding in unlocking. */
|
||||
kAchUnlockFail:4, /**< enum value is callback of failing to unlock. */
|
||||
kSocialSignInSucceed:5, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignInFail:6, /**< enum value is callback of failing to login. */
|
||||
kSocialSignOutSucceed:7, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignOutFail:8, /**< enum value is callback of failing to login. */
|
||||
kSocialGetGameFriends:9, /**< enum value is callback of failing to login. */
|
||||
kSocialExtensionCode :20000, /**< enum value is extension code . */
|
||||
kSocialGetFriendsInfoSuccess: 21001, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kSocialGetFriendsInfoFail: 21002, /**< enum value is callback of failing in getting user info. */
|
||||
kSocialAlreadySubscription: 21003, /**< enum value is callback of subscription . */
|
||||
kSocialNoSubscription: 21004, /**< enum value is callback No subscription. */
|
||||
kSocialSubscriptionFail: 21005, /**< enum value is callback of failing in subscription . */
|
||||
};
|
||||
|
||||
// for user action result code
|
||||
var UserActionResultCode = {
|
||||
kInitSuccess:0, /**< enum value is callback of succeeding in initing sdk. */
|
||||
kInitFail:1, /**< enum value is callback of failing to init sdk. */
|
||||
kLoginSuccess:2, /**< enum value is callback of succeeding in login.*/
|
||||
kLoginNetworkError:3, /**< enum value is callback of network error*/
|
||||
kLoginNoNeed:4, /**< enum value is callback of no need login.*/
|
||||
kLoginFail:5, /**< enum value is callback of failing to login. */
|
||||
kLoginCancel:6, /**< enum value is callback of canceling to login. */
|
||||
kLogoutSuccess:7, /**< enum value is callback of succeeding in logout. */
|
||||
kLogoutFail:8, /**< enum value is callback of failing to logout. */
|
||||
kPlatformEnter:9, /**< enum value is callback after enter platform. */
|
||||
kPlatformBack:10, /**< enum value is callback after exit antiAddiction. */
|
||||
kPausePage:11, /**< enum value is callback after exit pause page. */
|
||||
kExitPage:12, /**< enum value is callback after exit exit page. */
|
||||
kAntiAddictionQuery:13, /**< enum value is callback after querying antiAddiction. */
|
||||
kRealNameRegister:14, /**< enum value is callback after registering realname. */
|
||||
kAccountSwitchSuccess:15, /**< enum alue is callback of succeeding in switching account. */
|
||||
kAccountSwitchFail:16, /**< enum value is callback of failing to switch account. */
|
||||
kOpenShop:17 , /**< enum value is callback of open the shop. */
|
||||
kAccountSwitchCancel:18,/**< enum value is callback of canceling to switch account. */
|
||||
kUserExtension: 50000, /**< enum value is extension code . */
|
||||
kSendToDesktopSuccess: 51001, /**< enum value is callback of succeeding in sending to desktop. */
|
||||
kSendToDesktopFail: 51002, /**< enum value is callback of failing in sending to desktop. */
|
||||
kGetAvailableLoginTypeSuccess: 51003,/**< enum value is callback of succeeding in getting available login type. */
|
||||
kGetAvailableLoginTypeFail: 51004 ,/**< enum value is callback of failing in getting available login type. */
|
||||
kGetUserInfoSuccess: 51005, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kGetUserInfoFail: 51006 ,/**< enum value is callback of failing in getting user info. */
|
||||
kOpenBBSSuccess: 51007, /**< enum value is callback of succeeding in opening BBS.*/
|
||||
kOpenBBSFail: 51008 /**< enum value is callback of failing in opening BBS. */
|
||||
};
|
||||
|
||||
//for toolBar place
|
||||
var ToolBarPlace = {
|
||||
kToolBarTopLeft:1, /**< enum the toolbar is at topleft. */
|
||||
kToolBarTopRight:2, /**< enum the toolbar is at topright. */
|
||||
kToolBarMidLeft:3, /**< enum the toolbar is at midleft. */
|
||||
kToolBarMidRight:4, /**< enum the toolbar is at midright. */
|
||||
kToolBarBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kToolBarBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
};
|
||||
|
||||
|
||||
//for analytics
|
||||
var AccountType = {
|
||||
ANONYMOUS:0,/**< enum value is anonymous typek. */
|
||||
REGISTED:1,/**< enum value is registed type. */
|
||||
SINA_WEIBO:2,/**< enum value is sineweibo type. */
|
||||
TENCENT_WEIBO:3,/**< enum value is tecentweibo type */
|
||||
QQ:4,/**< enum value is qq type */
|
||||
ND91:5/**< enum value is nd91 type. */
|
||||
};
|
||||
|
||||
var AccountOperate = {
|
||||
LOGIN:0,/**< enum value is the login operate. */
|
||||
LOGOUT:1,/**< enum value is the logout operate. */
|
||||
REGISTER:2/**< enum value is the register operate. */
|
||||
};
|
||||
|
||||
var AccountGender = {
|
||||
MALE:0,/**< enum value is male. */
|
||||
FEMALE:1,/**< enum value is female. */
|
||||
UNKNOWN:2/**< enum value is unknow. */
|
||||
};
|
||||
|
||||
var TaskType = {
|
||||
GUIDE_LINE:0,/**< enum value is the guideline type.. */
|
||||
MAIN_LINE:1,/**< enum value is the mainline type.. */
|
||||
BRANCH_LINE:2,/**<enum value is the branchline type.. */
|
||||
DAILY:3,/**< enum value is the daily type.. */
|
||||
ACTIVITY:4,/**< enum value is the activity type. */
|
||||
OTHER:5/**< enum value is other type. */
|
||||
};
|
||||
//end analytics
|
||||
@@ -1,90 +0,0 @@
|
||||
{
|
||||
"anysdk": {
|
||||
"args": {
|
||||
"noupdate": 0,
|
||||
"staging": 1,
|
||||
"verbose": 1,
|
||||
"plugin": "~/.cocos/package/plugins/cocospackage-multi_anysdk/",
|
||||
"skip_patch": 0,
|
||||
"area": "cn",
|
||||
"server": "download.anysdk.com/cocospackage/v1/",
|
||||
"project": "./",
|
||||
"platform": "android",
|
||||
"command": "import",
|
||||
"mode": "debug",
|
||||
"installer": "~/cocos2d-x-3.10/tools/cocos2d-console/plugins/plugin_package/cocospackage.py",
|
||||
"config": "config.json"
|
||||
},
|
||||
"name": "cocospackage-multi_anysdk",
|
||||
"constants": {
|
||||
"ANDROID_STUDIO_JNI_DIR": "frameworks/runtime-src/proj.android-studio/app/jni/",
|
||||
"suffix": "JsTutorial",
|
||||
"COCOS_BACKUP_DIR": "cocospackage-backup-2016-07-11-18-29-08/",
|
||||
"COCOS_PROJECT_DIR": "./",
|
||||
"COCOS_2DX_INSTALLATION_VERSION": "3.10.0",
|
||||
"PLUGIN_PATCH_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/patchs/",
|
||||
"android_js_sources": [
|
||||
"../../Classes/jsb_anysdk_basic_conversions.cpp",
|
||||
"../../Classes/manualanysdkbindings.cpp",
|
||||
"../../Classes/jsb_anysdk_protocols_auto.cpp"
|
||||
],
|
||||
"ANDROID_STUDIO_PROJECT_DIR": "frameworks/runtime-src/proj.android-studio/",
|
||||
"ANDROID_COCOS_PACKAGE_ROOT": "frameworks/cocos2d-x/cocos/platform/android/java/",
|
||||
"PLUGIN_LUA_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/luabindings/",
|
||||
"ios_sources": [
|
||||
"SDKManager.cpp",
|
||||
"SDKManager.cpp"
|
||||
],
|
||||
"PLUGIN_JS_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/jsbindings/",
|
||||
"ANDROID_STUDIO_ACTIVITY_NAME": "AppActivity",
|
||||
"ios_js_sources": [
|
||||
"jsb_anysdk_basic_conversions.cpp",
|
||||
"manualanysdkbindings.cpp",
|
||||
"jsb_anysdk_protocols_auto.cpp"
|
||||
],
|
||||
"COCOS_PROJECT_HINT": "frameworks/runtime-src/",
|
||||
"ANDROID_STUDIO_PROPERTIES": "frameworks/runtime-src/proj.android-studio/app/build.gradle",
|
||||
"COCOS_ENGINE_TYPE": "unknown",
|
||||
"ANDROID_PROJECT_DIR": "frameworks/runtime-src/proj.android/",
|
||||
"ANDROID_COCOS_SRC_DIR": "frameworks/cocos2d-x/cocos/platform/android/java/src/org/cocos2dx/lib/",
|
||||
"COCOS_CLASSES_DIR": "frameworks/runtime-src/Classes/",
|
||||
"XCODE_PROJECT": "frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj",
|
||||
"COCOSPACKAGE_DIR": "~/.cocos/package/",
|
||||
"ANDROID_STUDIO_ACTIVITY_PATH": "frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/",
|
||||
"ANDROID_SDK_DIR": "~/sdk/",
|
||||
"COCOS_2DX_ROOT": "~/cocos2d-x-3.10/",
|
||||
"PLUGIN_ROOT": "~/.cocos/package/plugins/cocospackage-multi_anysdk/",
|
||||
"COCOSPACKAGE_PUGIN_NAME": "~/.cocos/package/plugins/cocospackage-multi_anysdk/",
|
||||
"ANDROID_MANIFEST": "frameworks/runtime-src/proj.android/AndroidManifest.xml",
|
||||
"ANDROID_STUDIO_MANIFEST": "frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml",
|
||||
"ANDROID_JNI_DIR": "frameworks/runtime-src/proj.android/jni/",
|
||||
"ANDROID_ACTIVITY_NAME": "AppActivity",
|
||||
"IOS_PROJECT_DIR": "frameworks/runtime-src/proj.ios_mac/",
|
||||
"XCODE_PROJECT_CXX_LIBRARY": "libc++",
|
||||
"ANDROID_STUDIO_MK": "frameworks/runtime-src/proj.android-studio/app/jni/Android.mk",
|
||||
"PLUGIN_ANDROID_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/android/",
|
||||
"XCODE_PROJECT_DIR": "frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/",
|
||||
"COCOS_PACKAGE_DIR": "~/cocos2d-x-lite/external/package/",
|
||||
"url": "http://docs.anysdk.com/JsTutorial",
|
||||
"COCOS_PROJECT_TYPE": "js",
|
||||
"COCOS_2DX_VERSION": "3.10.0",
|
||||
"ANDROID_PROPERTIES": "frameworks/runtime-src/proj.android/project.properties",
|
||||
"PLUGIN_IOS_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/ios/",
|
||||
"ANDROID_ACTIVITY_PATH": "frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/",
|
||||
"android_sources": [
|
||||
"../../Classes/SDKManager.cpp",
|
||||
"../../Classes/SDKManager.cpp"
|
||||
],
|
||||
"ANDROID_MK": "frameworks/runtime-src/proj.android/jni/Android.mk",
|
||||
"ANDROID_STUDIO_LIBS_DIR": "frameworks/cocos2d-x/cocos/platform/android/libcocos2dx/libs/",
|
||||
"ANDROID_LIBS_DIR": "frameworks/cocos2d-x/cocos/platform/android/java/libs/",
|
||||
"COCOS_RESOURCES_DIR": "res/"
|
||||
},
|
||||
"versions": {
|
||||
"mini_cocospackage_version": "0.8.0",
|
||||
"code": "1001",
|
||||
"show_version": "2.0.1_2.2.1",
|
||||
"update_content": "2016\u5e747\u670810\u66f4\u65b0 \n 1\u3001\u6846\u67b6\u652f\u6301cocos2d-x-3.9.1 \u5f15\u64ce \n 2\u3001patchs \u6587\u4ef6\u652f\u6301cocos2d-x-3.12"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,26 @@
|
||||
"do_default":{
|
||||
"exclude_from_template":[
|
||||
"frameworks/runtime-src"
|
||||
],
|
||||
"append_dir":[
|
||||
{
|
||||
"from":"extensions/anysdk/",
|
||||
"to":"",
|
||||
"include": [
|
||||
".cocos-package.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/js-bindings/",
|
||||
"to":"frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"*.h",
|
||||
"*.cpp",
|
||||
"*.hpp"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
},
|
||||
"do_add_native_support":{
|
||||
"append_from_template":{
|
||||
@@ -19,13 +38,20 @@
|
||||
]
|
||||
},
|
||||
"append_dir":[
|
||||
{
|
||||
"from":"extensions/anysdk/js-bindings/",
|
||||
"to":"frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"*"
|
||||
{
|
||||
"from":"extensions/anysdk/platform/android",
|
||||
"to":"frameworks/runtime-src/proj.android",
|
||||
"exclude": [
|
||||
"res/mipmap"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/platform/android",
|
||||
"to":"frameworks/runtime-src/proj.android-studio/app",
|
||||
"exclude": [
|
||||
"res/drawable"
|
||||
]
|
||||
}
|
||||
],
|
||||
"append_x_engine":{
|
||||
"from":".",
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "SDKManager.h"
|
||||
|
||||
using namespace anysdk::framework;
|
||||
|
||||
SDKManager* SDKManager::_pInstance = NULL;
|
||||
|
||||
SDKManager::SDKManager()
|
||||
{
|
||||
}
|
||||
|
||||
SDKManager::~SDKManager()
|
||||
{
|
||||
_pAgent->unloadAllPlugins();
|
||||
}
|
||||
|
||||
SDKManager* SDKManager::getInstance()
|
||||
{
|
||||
if (_pInstance == NULL) {
|
||||
_pInstance = new SDKManager();
|
||||
}
|
||||
return _pInstance;
|
||||
}
|
||||
|
||||
void SDKManager::purge()
|
||||
{
|
||||
if (_pInstance)
|
||||
{
|
||||
delete _pInstance;
|
||||
_pInstance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void SDKManager::loadAllPlugins()
|
||||
{
|
||||
/**
|
||||
* appKey, appSecret and privateKey are the only three parameters generated
|
||||
* after the packing tool client finishes creating the game.
|
||||
* The oauthLoginServer parameter is the API address provided by the game service
|
||||
* to login verification
|
||||
*/
|
||||
std::string oauthLoginServer = "OAUTH_LOGIN_SERVER";
|
||||
std::string appKey = "APP_KEY";
|
||||
std::string appSecret = "APP_SERCRET";
|
||||
std::string privateKey = "PRIVATE_KEY";
|
||||
|
||||
AgentManager* pAgent = AgentManager::getInstance();
|
||||
pAgent->init(appKey,appSecret,privateKey,oauthLoginServer);
|
||||
|
||||
//Initialize plug-ins, including SDKs.
|
||||
pAgent->loadAllPlugins();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#ifndef __SDK_MANAGER_H__
|
||||
#define __SDK_MANAGER_H__
|
||||
|
||||
#include "AgentManager.h"
|
||||
using namespace anysdk::framework;
|
||||
using namespace std;
|
||||
class SDKManager
|
||||
{
|
||||
public:
|
||||
static SDKManager* getInstance();
|
||||
static void purge();
|
||||
|
||||
void loadAllPlugins();
|
||||
|
||||
private:
|
||||
SDKManager();
|
||||
virtual ~SDKManager();
|
||||
|
||||
static SDKManager* _pInstance;
|
||||
|
||||
AgentManager* _pAgent;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<ImageView
|
||||
android:id="@+id/plugin_image_ad"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@mipmap/plugin_ui_ad" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/plugin_image_close"
|
||||
android:layout_width="20dip"
|
||||
android:layout_height="20dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@mipmap/plugin_btn_close" />
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="80dp"
|
||||
android:text="@string/plugin_login_account"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:layout_toRightOf="@id/username"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="@string/plugin_login_password"
|
||||
android:layout_below="@id/username"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_toRightOf="@id/password"
|
||||
android:layout_below="@id/txt_username"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height= "25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="@string/plugin_tips"
|
||||
android:layout_below="@id/password"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">Account login</string>
|
||||
<string name="plugin_login_account">Account</string>
|
||||
<string name="plugin_login_password">Password</string>
|
||||
<string name="plugin_login">Login</string>
|
||||
<string name="plugin_cancel">Cancel</string>
|
||||
<string name="plugin_pay_content">Do you confirm the payment?</string>
|
||||
<string name="plugin_pay">Pay</string>
|
||||
<string name="plugin_rank">Rank</string>
|
||||
<string name="plugin_achievement">Achievement</string>
|
||||
<string name="plugin_center">Platform center</string>
|
||||
<string name="plugin_showTool">Show toolbar</string>
|
||||
<string name="plugin_hideTool">Hide toolbar</string>
|
||||
<string name="plugin_realNameRegister">Real-name registration</string>
|
||||
<string name="plugin_antiAddictionQuery">Anti-addiction query</string>
|
||||
<string name="plugin_exit">Exit</string>
|
||||
<string name="plugin_pause">Pause the game</string>
|
||||
<string name="plugin_sure">Confirm</string>
|
||||
<string name="plugin_accountSwitch">Switch account</string>
|
||||
<string name="plugin_logout">Logout</string>
|
||||
<string name="plugin_submitLoginGameRole">Submit the role information</string>
|
||||
<string name="plugin_tips">Test mode, not for official release!</string>
|
||||
<string name="plugin_waiting">Just a moment please</string>
|
||||
<string name="plugin_data">Data is communication</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">账号登陆</string>
|
||||
<string name="plugin_login_account">账号</string>
|
||||
<string name="plugin_login_password">密码</string>
|
||||
<string name="plugin_login">登陆</string>
|
||||
<string name="plugin_cancel">取消</string>
|
||||
<string name="plugin_pay_content">是否确认支付?</string>
|
||||
<string name="plugin_pay">支付</string>
|
||||
<string name="plugin_rank">排行榜</string>
|
||||
<string name="plugin_achievement">成就榜</string>
|
||||
<string name="plugin_center">平台中心</string>
|
||||
<string name="plugin_showTool">工具栏</string>
|
||||
<string name="plugin_hideTool">隐藏工具栏</string>
|
||||
<string name="plugin_realNameRegister">实名注册</string>
|
||||
<string name="plugin_antiAddictionQuery">防沉迷查询</string>
|
||||
<string name="plugin_exit">退出</string>
|
||||
<string name="plugin_pause">暂停游戏</string>
|
||||
<string name="plugin_sure">确认</string>
|
||||
<string name="plugin_accountSwitch">切换账号</string>
|
||||
<string name="plugin_logout">登出</string>
|
||||
<string name="plugin_submitLoginGameRole">提交角色信息</string>
|
||||
<string name="plugin_tips">测试模式,不能用于渠道发布</string>
|
||||
<string name="plugin_waiting">请稍等</string>
|
||||
<string name="plugin_data">数据通信中...</string>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,118 +0,0 @@
|
||||
package org.cocos2dx.javascript;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.opengl.GLSurfaceView;
|
||||
|
||||
public class SDKWrapper {
|
||||
private final static boolean PACKAGE_AS = true;
|
||||
private static Class<?> mClass = null;
|
||||
|
||||
private static SDKWrapper mInstace = null;
|
||||
public static SDKWrapper getInstance() {
|
||||
if (null == mInstace){
|
||||
mInstace = new SDKWrapper();
|
||||
try {
|
||||
String fullName = "com.anysdk.framework.PluginWrapper";
|
||||
mClass = Class.forName(fullName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return mInstace;
|
||||
}
|
||||
|
||||
public void init(Context context) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("init", Context.class).invoke(mClass, context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
SDKWrapper.nativeLoadAllPlugins();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setGLSurfaceView(GLSurfaceView view) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onResume").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onPause").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onDestroy").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewIntent(Intent intent) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onRestart() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onRestart").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onStop() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onStop").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nativeLoadAllPlugins();
|
||||
}
|
||||
|
Before Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<ImageView
|
||||
android:id="@+id/plugin_image_ad"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@drawable/plugin_ui_ad" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/plugin_image_close"
|
||||
android:layout_width="20dip"
|
||||
android:layout_height="20dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@drawable/plugin_btn_close" />
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="80dp"
|
||||
android:text="@string/plugin_login_account"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:layout_toRightOf="@id/username"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="@string/plugin_login_password"
|
||||
android:layout_below="@id/username"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_toRightOf="@id/password"
|
||||
android:layout_below="@id/txt_username"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height= "25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="@string/plugin_tips"
|
||||
android:layout_below="@id/password"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">Account login</string>
|
||||
<string name="plugin_login_account">Account</string>
|
||||
<string name="plugin_login_password">Password</string>
|
||||
<string name="plugin_login">Login</string>
|
||||
<string name="plugin_cancel">Cancel</string>
|
||||
<string name="plugin_pay_content">Do you confirm the payment?</string>
|
||||
<string name="plugin_pay">Pay</string>
|
||||
<string name="plugin_rank">Rank</string>
|
||||
<string name="plugin_achievement">Achievement</string>
|
||||
<string name="plugin_center">Platform center</string>
|
||||
<string name="plugin_showTool">Show toolbar</string>
|
||||
<string name="plugin_hideTool">Hide toolbar</string>
|
||||
<string name="plugin_realNameRegister">Real-name registration</string>
|
||||
<string name="plugin_antiAddictionQuery">Anti-addiction query</string>
|
||||
<string name="plugin_exit">Exit</string>
|
||||
<string name="plugin_pause">Pause the game</string>
|
||||
<string name="plugin_sure">Confirm</string>
|
||||
<string name="plugin_accountSwitch">Switch account</string>
|
||||
<string name="plugin_logout">Logout</string>
|
||||
<string name="plugin_submitLoginGameRole">Submit the role information</string>
|
||||
<string name="plugin_tips">Test mode, not for official release!</string>
|
||||
<string name="plugin_waiting">Just a moment please</string>
|
||||
<string name="plugin_data">Data is communication</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">账号登陆</string>
|
||||
<string name="plugin_login_account">账号</string>
|
||||
<string name="plugin_login_password">密码</string>
|
||||
<string name="plugin_login">登陆</string>
|
||||
<string name="plugin_cancel">取消</string>
|
||||
<string name="plugin_pay_content">是否确认支付?</string>
|
||||
<string name="plugin_pay">支付</string>
|
||||
<string name="plugin_rank">排行榜</string>
|
||||
<string name="plugin_achievement">成就榜</string>
|
||||
<string name="plugin_center">平台中心</string>
|
||||
<string name="plugin_showTool">工具栏</string>
|
||||
<string name="plugin_hideTool">隐藏工具栏</string>
|
||||
<string name="plugin_realNameRegister">实名注册</string>
|
||||
<string name="plugin_antiAddictionQuery">防沉迷查询</string>
|
||||
<string name="plugin_exit">退出</string>
|
||||
<string name="plugin_pause">暂停游戏</string>
|
||||
<string name="plugin_sure">确认</string>
|
||||
<string name="plugin_accountSwitch">切换账号</string>
|
||||
<string name="plugin_logout">登出</string>
|
||||
<string name="plugin_submitLoginGameRole">提交角色信息</string>
|
||||
<string name="plugin_tips">测试模式,不能用于渠道发布</string>
|
||||
<string name="plugin_waiting">请稍等</string>
|
||||
<string name="plugin_data">数据通信中...</string>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,118 +0,0 @@
|
||||
package org.cocos2dx.javascript;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.opengl.GLSurfaceView;
|
||||
|
||||
public class SDKWrapper {
|
||||
private final static boolean PACKAGE_AS = true;
|
||||
private static Class<?> mClass = null;
|
||||
|
||||
private static SDKWrapper mInstace = null;
|
||||
public static SDKWrapper getInstance() {
|
||||
if (null == mInstace){
|
||||
mInstace = new SDKWrapper();
|
||||
try {
|
||||
String fullName = "com.anysdk.framework.PluginWrapper";
|
||||
mClass = Class.forName(fullName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return mInstace;
|
||||
}
|
||||
|
||||
public void init(Context context) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("init", Context.class).invoke(mClass, context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
SDKWrapper.nativeLoadAllPlugins();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setGLSurfaceView(GLSurfaceView view) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onResume").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onPause").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onDestroy").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewIntent(Intent intent) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onRestart() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onRestart").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onStop() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onStop").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nativeLoadAllPlugins();
|
||||
}
|
||||
@@ -1,226 +0,0 @@
|
||||
anysdk.agentManager = anysdk.AgentManager.getInstance();
|
||||
|
||||
anysdk.callWrapper = function(plugin, func){
|
||||
plugin[func.name] = (function(){
|
||||
var params = [];
|
||||
if(arguments){
|
||||
var l = arguments.length;
|
||||
for (var i = 0; i < l; i++) {
|
||||
var arg = arguments[i];
|
||||
var param = anysdk.PluginParam.create(arg);
|
||||
params.push(param);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.returnType == "void"){
|
||||
plugin.callFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "boolean"){
|
||||
return plugin.callBoolFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "int"){
|
||||
return plugin.callIntFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "float"){
|
||||
return plugin.callFloatFuncWithParam(this.name, params);
|
||||
}else {
|
||||
return plugin.callStringFuncWithParam(this.name, params);
|
||||
}
|
||||
}).bind(func);
|
||||
}
|
||||
|
||||
anysdk.parseData = function(data){
|
||||
var jsonData = [];
|
||||
var substring = data.substring(1, data.length - 2)
|
||||
var array = substring.split(",");
|
||||
for (var i = 0; i < array.length; i++ ){
|
||||
var functionData = array[i].split("&");
|
||||
var funcParam = {};
|
||||
for(var j = 0; j < functionData.length; j++){
|
||||
var itemData = functionData[j].split("=");
|
||||
if(itemData.length > 1)
|
||||
{
|
||||
funcParam[itemData[0]] = itemData[1];
|
||||
}
|
||||
}
|
||||
jsonData.push(funcParam)
|
||||
|
||||
}
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
anysdk.registerAPIs = function(plugin) {
|
||||
var functionString = anysdk.JSBRelation.getMethodsOfPlugin(plugin);
|
||||
var data = anysdk.parseData(functionString);
|
||||
for (var i = 0; i < data.length; i++ ){
|
||||
var name = data[i].name;
|
||||
if(name && !plugin[name]){
|
||||
cc.log("plugin: " + name + " auto binding");
|
||||
anysdk.callWrapper(plugin, data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
anysdk.agentManager._loadAllPlugins = anysdk.agentManager.loadAllPlugins;
|
||||
anysdk.agentManager.loadAllPlugins = function (callback, target) {
|
||||
anysdk.agentManager._loadAllPlugins();
|
||||
if(callback){
|
||||
if (target){
|
||||
callback.call(target, 0, "loadAllPlugins finish");
|
||||
}else{
|
||||
callback(0, "loadAllPlugins finish");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anysdk.agentManager._getUserPlugin = anysdk.agentManager.getUserPlugin;
|
||||
anysdk.agentManager.getUserPlugin = function () {
|
||||
var plugin = this._getUserPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
plugin.setListener = function(callback, target){
|
||||
var onUserResult = function(plugin, code, msg){
|
||||
if (target){
|
||||
callback.call(target, code, msg);
|
||||
}else{
|
||||
callback(code, msg);
|
||||
}
|
||||
}
|
||||
plugin.setActionListener(onUserResult,this);
|
||||
};
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getIAPPlugin = anysdk.agentManager.getIAPPlugin;
|
||||
anysdk.agentManager.getIAPPlugins = function () {
|
||||
var plugins = this._getIAPPlugin();
|
||||
if (plugins) {
|
||||
for (var item in plugins){
|
||||
if (plugins.hasOwnProperty(item)){
|
||||
var plugin = plugins[item];
|
||||
if (!plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
return plugins;
|
||||
}
|
||||
|
||||
anysdk.agentManager.getIAPPlugin = function () {
|
||||
var iapPlugins = anysdk.agentManager.getIAPPlugins();
|
||||
if(iapPlugins != null){
|
||||
for(var item in iapPlugins){
|
||||
if (iapPlugins.hasOwnProperty(item)) {
|
||||
return iapPlugins[item];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
anysdk.agentManager._getAdsPlugin = anysdk.agentManager.getAdsPlugin;
|
||||
anysdk.agentManager.getAdsPlugin = function () {
|
||||
var plugin = this._getAdsPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setAdsListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getSocialPlugin = anysdk.agentManager.getSocialPlugin;
|
||||
anysdk.agentManager.getSocialPlugin = function () {
|
||||
var plugin = this._getSocialPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getSharePlugin = anysdk.agentManager.getSharePlugin;
|
||||
anysdk.agentManager.getSharePlugin = function () {
|
||||
var plugin = this._getSharePlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getPushPlugin = anysdk.agentManager.getPushPlugin;
|
||||
anysdk.agentManager.getPushPlugin = function () {
|
||||
var plugin = this._getPushPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setActionListener;
|
||||
plugin.isInitialized = true;
|
||||
plugin.setListener = function(callback, target){
|
||||
var onPushResult = function(plugin, code, msg){
|
||||
if (target){
|
||||
callback.call(target, code, msg);
|
||||
}else{
|
||||
callback(code, msg);
|
||||
}
|
||||
}
|
||||
plugin.setActionListener(onPushResult,this);
|
||||
};
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getAnalyticsPlugin = anysdk.agentManager.getAnalyticsPlugin;
|
||||
anysdk.agentManager.getAnalyticsPlugin = function () {
|
||||
var plugin = this._getAnalyticsPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getRECPlugin = anysdk.agentManager.getRECPlugin;
|
||||
anysdk.agentManager.getRECPlugin = function () {
|
||||
var plugin = this._getRECPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getCustomPlugin = anysdk.agentManager.getCustomPlugin;
|
||||
anysdk.agentManager.getCustomPlugin = function () {
|
||||
var plugin = this._getCustomPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getCrashPlugin = anysdk.agentManager.getCrashPlugin;
|
||||
anysdk.agentManager.getCrashPlugin = function () {
|
||||
var plugin = this._getCrashPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getAdTrackingPlugin = anysdk.agentManager.getAdTrackingPlugin;
|
||||
anysdk.agentManager.getAdTrackingPlugin = function () {
|
||||
var plugin = this._getAdTrackingPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
@@ -1,403 +0,0 @@
|
||||
//for plugin type
|
||||
anysdk.PluginType = {
|
||||
kPluginAds:16,/**< enum value is the type of Ads. */
|
||||
kPluginAnalytics:1,/**< enum value is the type of Analytics. */
|
||||
kPluginIAP:8,/**< enum value is the type of IAP. */
|
||||
kPluginShare:2,/**< enum value is the type of Share. */
|
||||
kPluginUser:32,/**< enum value is the type of User. */
|
||||
kPluginSocial:4,/**< enum value is the type of Social. */
|
||||
kPluginPush:64,/**< enum value is the type of Push. */
|
||||
kPluginCrash:128,/**< enum value is the type of Crash. */
|
||||
kPluginCustom:256,/**< enum value is the type of Custom. */
|
||||
kPluginREC:512,/**< enum value is the type of REC. */
|
||||
kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
|
||||
|
||||
}; //plugin type
|
||||
|
||||
//for Custom
|
||||
anysdk.CustomResultCode = {
|
||||
kCustomExtension:80000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
anysdk.RECResultCode = {
|
||||
kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
|
||||
kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
|
||||
kRECStartRecording:2,/**< enum value is callback of starting to record. */
|
||||
kRECStopRecording:3,/**< enum value is callback of stoping to record. */
|
||||
kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
|
||||
kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
|
||||
kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
|
||||
kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
|
||||
kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
|
||||
kRECShareFail:9,/**< enum value is callback of failing to share. */
|
||||
kRECExtension:90000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
//for ads
|
||||
anysdk.AdsResultCode = {
|
||||
kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
|
||||
kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
|
||||
kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
|
||||
kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
|
||||
kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
|
||||
kNetworkError:5, /**< enum the callback of Network error at center. */
|
||||
kUnknownError:6, /**< enum the callback of Unknown error. */
|
||||
kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
|
||||
kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
|
||||
kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
|
||||
kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
|
||||
kAdsExtension :40000 /**< enum value is extension code . */
|
||||
}; //ads result code
|
||||
|
||||
anysdk.AdsPos = {
|
||||
kPosCenter:0, /**< enum the toolbar is at center. */
|
||||
kPosTop:1, /**< enum the toolbar is at top. */
|
||||
kPosTopLeft:2, /**< enum the toolbar is at topleft. */
|
||||
kPosTopRight:3, /**< enum the toolbar is at topright. */
|
||||
kPosBottom:4, /**< enum the toolbar is at bottom. */
|
||||
kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
}; //ads pos
|
||||
|
||||
anysdk.AdsType = {
|
||||
AD_TYPE_BANNER:0, /**< enum value is banner ads . */
|
||||
AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
|
||||
AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
|
||||
AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
|
||||
AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
|
||||
AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
|
||||
AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
|
||||
}; //ads type
|
||||
|
||||
//for pay result code
|
||||
anysdk.PayResultCode = {
|
||||
kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
|
||||
kPayFail:1, /**< enum value is callback of failing to pay . */
|
||||
kPayCancel:2, /**< enum value is callback of canceling to pay . */
|
||||
kPayNetworkError:3, /**< enum value is callback of network error . */
|
||||
kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
|
||||
kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
|
||||
kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
|
||||
kPayNowPaying:7, /**< enum value is callback of paying now . */
|
||||
kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
|
||||
kPayExtension : 30000, /**< enum value is extension code . */
|
||||
kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
|
||||
};
|
||||
|
||||
anysdk.RequestResultCode = {
|
||||
kRequestSuccess:31000, /**<enum value is callback of succeeding in paying . */
|
||||
kRequestFail:31001 /**<enum value is callback of failing to pay . */
|
||||
};
|
||||
|
||||
// for push action result code
|
||||
anysdk.PushActionResultCode = {
|
||||
kPushReceiveMessage:0, /**value is callback of Receiving Message . */
|
||||
kPushExtensionCode : 60000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
// for share result code
|
||||
anysdk.ShareResultCode = {
|
||||
kShareSuccess:0, /**< enum value is callback of failing to sharing . */
|
||||
kShareFail:1, /**< enum value is callback of failing to share . */
|
||||
kShareCancel:2, /**< enum value is callback of canceling to share . */
|
||||
kShareNetworkError:3, /**< enum value is callback of network error . */
|
||||
kShareExtension :10000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
//for social ret code
|
||||
anysdk.SocialRetCode = {
|
||||
// code for leaderboard feature
|
||||
kScoreSubmitSucceed:1, /**< enum value is callback of succeeding in submiting. */
|
||||
kScoreSubmitfail:2, /**< enum value is callback of failing to submit . */
|
||||
// code for achievement feature
|
||||
kAchUnlockSucceed:3, /**< enum value is callback of succeeding in unlocking. */
|
||||
kAchUnlockFail:4, /**< enum value is callback of failing to unlock. */
|
||||
kSocialSignInSucceed:5, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignInFail:6, /**< enum value is callback of failing to login. */
|
||||
kSocialSignOutSucceed:7, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignOutFail:8, /**< enum value is callback of failing to login. */
|
||||
kSocialGetGameFriends:9, /**< enum value is callback of failing to login. */
|
||||
kSocialExtensionCode :20000, /**< enum value is extension code . */
|
||||
kSocialGetFriendsInfoSuccess: 21001, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kSocialGetFriendsInfoFail: 21002, /**< enum value is callback of failing in getting user info. */
|
||||
kSocialAlreadySubscription: 21003, /**< enum value is callback of subscription . */
|
||||
kSocialNoSubscription: 21004, /**< enum value is callback No subscription. */
|
||||
kSocialSubscriptionFail: 21005, /**< enum value is callback of failing in subscription . */
|
||||
};
|
||||
|
||||
// for user action result code
|
||||
anysdk.UserActionResultCode = {
|
||||
kInitSuccess:0, /**< enum value is callback of succeeding in initing sdk. */
|
||||
kInitFail:1, /**< enum value is callback of failing to init sdk. */
|
||||
kLoginSuccess:2, /**< enum value is callback of succeeding in login.*/
|
||||
kLoginNetworkError:3, /**< enum value is callback of network error*/
|
||||
kLoginNoNeed:4, /**< enum value is callback of no need login.*/
|
||||
kLoginFail:5, /**< enum value is callback of failing to login. */
|
||||
kLoginCancel:6, /**< enum value is callback of canceling to login. */
|
||||
kLogoutSuccess:7, /**< enum value is callback of succeeding in logout. */
|
||||
kLogoutFail:8, /**< enum value is callback of failing to logout. */
|
||||
kPlatformEnter:9, /**< enum value is callback after enter platform. */
|
||||
kPlatformBack:10, /**< enum value is callback after exit antiAddiction. */
|
||||
kPausePage:11, /**< enum value is callback after exit pause page. */
|
||||
kExitPage:12, /**< enum value is callback after exit exit page. */
|
||||
kAntiAddictionQuery:13, /**< enum value is callback after querying antiAddiction. */
|
||||
kRealNameRegister:14, /**< enum value is callback after registering realname. */
|
||||
kAccountSwitchSuccess:15, /**< enum alue is callback of succeeding in switching account. */
|
||||
kAccountSwitchFail:16, /**< enum value is callback of failing to switch account. */
|
||||
kOpenShop:17 , /**< enum value is callback of open the shop. */
|
||||
kAccountSwitchCancel:18,/**< enum value is callback of canceling to switch account. */
|
||||
kUserExtension: 50000, /**< enum value is extension code . */
|
||||
kSendToDesktopSuccess: 51001, /**< enum value is callback of succeeding in sending to desktop. */
|
||||
kSendToDesktopFail: 51002, /**< enum value is callback of failing in sending to desktop. */
|
||||
kGetAvailableLoginTypeSuccess: 51003,/**< enum value is callback of succeeding in getting available login type. */
|
||||
kGetAvailableLoginTypeFail: 51004 ,/**< enum value is callback of failing in getting available login type. */
|
||||
kGetUserInfoSuccess: 51005, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kGetUserInfoFail: 51006 ,/**< enum value is callback of failing in getting user info. */
|
||||
kOpenBBSSuccess: 51007, /**< enum value is callback of succeeding in opening BBS.*/
|
||||
kOpenBBSFail: 51008 /**< enum value is callback of failing in opening BBS. */
|
||||
|
||||
};
|
||||
|
||||
//for toolBar place
|
||||
anysdk.ToolBarPlace = {
|
||||
kToolBarTopLeft:1, /**< enum the toolbar is at topleft. */
|
||||
kToolBarTopRight:2, /**< enum the toolbar is at topright. */
|
||||
kToolBarMidLeft:3, /**< enum the toolbar is at midleft. */
|
||||
kToolBarMidRight:4, /**< enum the toolbar is at midright. */
|
||||
kToolBarBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kToolBarBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
};
|
||||
|
||||
|
||||
//for analytics
|
||||
anysdk.AccountType = {
|
||||
ANONYMOUS:0,/**< enum value is anonymous typek. */
|
||||
REGISTED:1,/**< enum value is registed type. */
|
||||
SINA_WEIBO:2,/**< enum value is sineweibo type. */
|
||||
TENCENT_WEIBO:3,/**< enum value is tecentweibo type */
|
||||
QQ:4,/**< enum value is qq type */
|
||||
ND91:5/**< enum value is nd91 type. */
|
||||
};
|
||||
|
||||
anysdk.AccountOperate = {
|
||||
LOGIN:0,/**< enum value is the login operate. */
|
||||
LOGOUT:1,/**< enum value is the logout operate. */
|
||||
REGISTER:2/**< enum value is the register operate. */
|
||||
};
|
||||
|
||||
anysdk.AccountGender = {
|
||||
MALE:0,/**< enum value is male. */
|
||||
FEMALE:1,/**< enum value is female. */
|
||||
UNKNOWN:2/**< enum value is unknow. */
|
||||
};
|
||||
|
||||
anysdk.TaskType = {
|
||||
GUIDE_LINE:0,/**< enum value is the guideline type.. */
|
||||
MAIN_LINE:1,/**< enum value is the mainline type.. */
|
||||
BRANCH_LINE:2,/**<enum value is the branchline type.. */
|
||||
DAILY:3,/**< enum value is the daily type.. */
|
||||
ACTIVITY:4,/**< enum value is the activity type. */
|
||||
OTHER:5/**< enum value is other type. */
|
||||
};
|
||||
//end analytics
|
||||
|
||||
//for plugin type
|
||||
var PluginType = {
|
||||
kPluginAds:16,/**< enum value is the type of Ads. */
|
||||
kPluginAnalytics:1,/**< enum value is the type of Analytics. */
|
||||
kPluginIAP:8,/**< enum value is the type of IAP. */
|
||||
kPluginShare:2,/**< enum value is the type of Share. */
|
||||
kPluginUser:32,/**< enum value is the type of User. */
|
||||
kPluginSocial:4,/**< enum value is the type of Social. */
|
||||
kPluginPush:64,/**< enum value is the type of Push. */
|
||||
kPluginCrash:128,/**< enum value is the type of Crash. */
|
||||
kPluginCustom:256,/**< enum value is the type of Custom. */
|
||||
kPluginREC:512,/**< enum value is the type of REC. */
|
||||
kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
|
||||
}; //plugin type
|
||||
|
||||
//for Custom
|
||||
var CustomResultCode = {
|
||||
kCustomExtension:80000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
var RECResultCode = {
|
||||
kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
|
||||
kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
|
||||
kRECStartRecording:2,/**< enum value is callback of starting to record. */
|
||||
kRECStopRecording:3,/**< enum value is callback of stoping to record. */
|
||||
kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
|
||||
kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
|
||||
kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
|
||||
kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
|
||||
kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
|
||||
kRECShareFail:9,/**< enum value is callback of failing to share. */
|
||||
kRECExtension:90000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
//for ads
|
||||
var AdsResultCode = {
|
||||
kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
|
||||
kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
|
||||
kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
|
||||
kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
|
||||
kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
|
||||
kNetworkError:5, /**< enum the callback of Network error at center. */
|
||||
kUnknownError:6, /**< enum the callback of Unknown error. */
|
||||
kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
|
||||
kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
|
||||
kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
|
||||
kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
|
||||
kAdsExtension :40000 /**< enum value is extension code . */
|
||||
}; //ads result code
|
||||
|
||||
var AdsPos = {
|
||||
kPosCenter:0, /**< enum the toolbar is at center. */
|
||||
kPosTop:1, /**< enum the toolbar is at top. */
|
||||
kPosTopLeft:2, /**< enum the toolbar is at topleft. */
|
||||
kPosTopRight:3, /**< enum the toolbar is at topright. */
|
||||
kPosBottom:4, /**< enum the toolbar is at bottom. */
|
||||
kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
}; //ads pos
|
||||
|
||||
var AdsType = {
|
||||
AD_TYPE_BANNER:0, /**< enum value is banner ads . */
|
||||
AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
|
||||
AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
|
||||
AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
|
||||
AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
|
||||
AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
|
||||
AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
|
||||
}; //ads type
|
||||
|
||||
//for pay result code
|
||||
var PayResultCode = {
|
||||
kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
|
||||
kPayFail:1, /**< enum value is callback of failing to pay . */
|
||||
kPayCancel:2, /**< enum value is callback of canceling to pay . */
|
||||
kPayNetworkError:3, /**< enum value is callback of network error . */
|
||||
kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
|
||||
kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
|
||||
kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
|
||||
kPayNowPaying:7, /**< enum value is callback of paying now . */
|
||||
kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
|
||||
kPayExtension : 30000, /**< enum value is extension code . */
|
||||
kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
|
||||
};
|
||||
|
||||
var RequestResultCode = {
|
||||
kRequestSuccess:31000, /**<enum value is callback of succeeding in paying . */
|
||||
kRequestFail:31001 /**<enum value is callback of failing to pay . */
|
||||
};
|
||||
|
||||
// for push action result code
|
||||
var PushActionResultCode = {
|
||||
kPushReceiveMessage:0, /**value is callback of Receiving Message . */
|
||||
kPushExtensionCode : 60000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
// for share result code
|
||||
var ShareResultCode = {
|
||||
kShareSuccess:0, /**< enum value is callback of failing to sharing . */
|
||||
kShareFail:1, /**< enum value is callback of failing to share . */
|
||||
kShareCancel:2, /**< enum value is callback of canceling to share . */
|
||||
kShareNetworkError:3, /**< enum value is callback of network error . */
|
||||
kShareExtension :10000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
//for social ret code
|
||||
var SocialRetCode = {
|
||||
// code for leaderboard feature
|
||||
kScoreSubmitSucceed:1, /**< enum value is callback of succeeding in submiting. */
|
||||
kScoreSubmitfail:2, /**< enum value is callback of failing to submit . */
|
||||
// code for achievement feature
|
||||
kAchUnlockSucceed:3, /**< enum value is callback of succeeding in unlocking. */
|
||||
kAchUnlockFail:4, /**< enum value is callback of failing to unlock. */
|
||||
kSocialSignInSucceed:5, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignInFail:6, /**< enum value is callback of failing to login. */
|
||||
kSocialSignOutSucceed:7, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignOutFail:8, /**< enum value is callback of failing to login. */
|
||||
kSocialGetGameFriends:9, /**< enum value is callback of failing to login. */
|
||||
kSocialExtensionCode :20000, /**< enum value is extension code . */
|
||||
kSocialGetFriendsInfoSuccess: 21001, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kSocialGetFriendsInfoFail: 21002, /**< enum value is callback of failing in getting user info. */
|
||||
kSocialAlreadySubscription: 21003, /**< enum value is callback of subscription . */
|
||||
kSocialNoSubscription: 21004, /**< enum value is callback No subscription. */
|
||||
kSocialSubscriptionFail: 21005, /**< enum value is callback of failing in subscription . */
|
||||
};
|
||||
|
||||
// for user action result code
|
||||
var UserActionResultCode = {
|
||||
kInitSuccess:0, /**< enum value is callback of succeeding in initing sdk. */
|
||||
kInitFail:1, /**< enum value is callback of failing to init sdk. */
|
||||
kLoginSuccess:2, /**< enum value is callback of succeeding in login.*/
|
||||
kLoginNetworkError:3, /**< enum value is callback of network error*/
|
||||
kLoginNoNeed:4, /**< enum value is callback of no need login.*/
|
||||
kLoginFail:5, /**< enum value is callback of failing to login. */
|
||||
kLoginCancel:6, /**< enum value is callback of canceling to login. */
|
||||
kLogoutSuccess:7, /**< enum value is callback of succeeding in logout. */
|
||||
kLogoutFail:8, /**< enum value is callback of failing to logout. */
|
||||
kPlatformEnter:9, /**< enum value is callback after enter platform. */
|
||||
kPlatformBack:10, /**< enum value is callback after exit antiAddiction. */
|
||||
kPausePage:11, /**< enum value is callback after exit pause page. */
|
||||
kExitPage:12, /**< enum value is callback after exit exit page. */
|
||||
kAntiAddictionQuery:13, /**< enum value is callback after querying antiAddiction. */
|
||||
kRealNameRegister:14, /**< enum value is callback after registering realname. */
|
||||
kAccountSwitchSuccess:15, /**< enum alue is callback of succeeding in switching account. */
|
||||
kAccountSwitchFail:16, /**< enum value is callback of failing to switch account. */
|
||||
kOpenShop:17 , /**< enum value is callback of open the shop. */
|
||||
kAccountSwitchCancel:18,/**< enum value is callback of canceling to switch account. */
|
||||
kUserExtension: 50000, /**< enum value is extension code . */
|
||||
kSendToDesktopSuccess: 51001, /**< enum value is callback of succeeding in sending to desktop. */
|
||||
kSendToDesktopFail: 51002, /**< enum value is callback of failing in sending to desktop. */
|
||||
kGetAvailableLoginTypeSuccess: 51003,/**< enum value is callback of succeeding in getting available login type. */
|
||||
kGetAvailableLoginTypeFail: 51004 ,/**< enum value is callback of failing in getting available login type. */
|
||||
kGetUserInfoSuccess: 51005, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kGetUserInfoFail: 51006 ,/**< enum value is callback of failing in getting user info. */
|
||||
kOpenBBSSuccess: 51007, /**< enum value is callback of succeeding in opening BBS.*/
|
||||
kOpenBBSFail: 51008 /**< enum value is callback of failing in opening BBS. */
|
||||
};
|
||||
|
||||
//for toolBar place
|
||||
var ToolBarPlace = {
|
||||
kToolBarTopLeft:1, /**< enum the toolbar is at topleft. */
|
||||
kToolBarTopRight:2, /**< enum the toolbar is at topright. */
|
||||
kToolBarMidLeft:3, /**< enum the toolbar is at midleft. */
|
||||
kToolBarMidRight:4, /**< enum the toolbar is at midright. */
|
||||
kToolBarBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kToolBarBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
};
|
||||
|
||||
|
||||
//for analytics
|
||||
var AccountType = {
|
||||
ANONYMOUS:0,/**< enum value is anonymous typek. */
|
||||
REGISTED:1,/**< enum value is registed type. */
|
||||
SINA_WEIBO:2,/**< enum value is sineweibo type. */
|
||||
TENCENT_WEIBO:3,/**< enum value is tecentweibo type */
|
||||
QQ:4,/**< enum value is qq type */
|
||||
ND91:5/**< enum value is nd91 type. */
|
||||
};
|
||||
|
||||
var AccountOperate = {
|
||||
LOGIN:0,/**< enum value is the login operate. */
|
||||
LOGOUT:1,/**< enum value is the logout operate. */
|
||||
REGISTER:2/**< enum value is the register operate. */
|
||||
};
|
||||
|
||||
var AccountGender = {
|
||||
MALE:0,/**< enum value is male. */
|
||||
FEMALE:1,/**< enum value is female. */
|
||||
UNKNOWN:2/**< enum value is unknow. */
|
||||
};
|
||||
|
||||
var TaskType = {
|
||||
GUIDE_LINE:0,/**< enum value is the guideline type.. */
|
||||
MAIN_LINE:1,/**< enum value is the mainline type.. */
|
||||
BRANCH_LINE:2,/**<enum value is the branchline type.. */
|
||||
DAILY:3,/**< enum value is the daily type.. */
|
||||
ACTIVITY:4,/**< enum value is the activity type. */
|
||||
OTHER:5/**< enum value is other type. */
|
||||
};
|
||||
//end analytics
|
||||
@@ -1,90 +0,0 @@
|
||||
{
|
||||
"anysdk": {
|
||||
"args": {
|
||||
"noupdate": 0,
|
||||
"staging": 1,
|
||||
"verbose": 1,
|
||||
"plugin": "~/.cocos/package/plugins/cocospackage-multi_anysdk/",
|
||||
"skip_patch": 0,
|
||||
"area": "cn",
|
||||
"server": "download.anysdk.com/cocospackage/v1/",
|
||||
"project": "./",
|
||||
"platform": "android",
|
||||
"command": "import",
|
||||
"mode": "debug",
|
||||
"installer": "~/cocos2d-x-3.10/tools/cocos2d-console/plugins/plugin_package/cocospackage.py",
|
||||
"config": "config.json"
|
||||
},
|
||||
"name": "cocospackage-multi_anysdk",
|
||||
"constants": {
|
||||
"ANDROID_STUDIO_JNI_DIR": "frameworks/runtime-src/proj.android-studio/app/jni/",
|
||||
"suffix": "JsTutorial",
|
||||
"COCOS_BACKUP_DIR": "cocospackage-backup-2016-07-11-18-30-22/",
|
||||
"COCOS_PROJECT_DIR": "./",
|
||||
"COCOS_2DX_INSTALLATION_VERSION": "3.10.0",
|
||||
"PLUGIN_PATCH_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/patchs/",
|
||||
"android_js_sources": [
|
||||
"../../Classes/jsb_anysdk_basic_conversions.cpp",
|
||||
"../../Classes/manualanysdkbindings.cpp",
|
||||
"../../Classes/jsb_anysdk_protocols_auto.cpp"
|
||||
],
|
||||
"ANDROID_STUDIO_PROJECT_DIR": "frameworks/runtime-src/proj.android-studio/",
|
||||
"ANDROID_COCOS_PACKAGE_ROOT": "frameworks/runtime-src/proj.android/",
|
||||
"PLUGIN_LUA_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/luabindings/",
|
||||
"ios_sources": [
|
||||
"SDKManager.cpp",
|
||||
"SDKManager.cpp"
|
||||
],
|
||||
"PLUGIN_JS_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/jsbindings/",
|
||||
"ANDROID_STUDIO_ACTIVITY_NAME": "AppActivity",
|
||||
"ios_js_sources": [
|
||||
"jsb_anysdk_basic_conversions.cpp",
|
||||
"manualanysdkbindings.cpp",
|
||||
"jsb_anysdk_protocols_auto.cpp"
|
||||
],
|
||||
"COCOS_PROJECT_HINT": "frameworks/runtime-src/",
|
||||
"ANDROID_STUDIO_PROPERTIES": "frameworks/runtime-src/proj.android-studio/app/build.gradle",
|
||||
"COCOS_ENGINE_TYPE": "unknown",
|
||||
"ANDROID_PROJECT_DIR": "frameworks/runtime-src/proj.android/",
|
||||
"ANDROID_COCOS_SRC_DIR": "frameworks/runtime-src/proj.android/src/org/cocos2dx/lib/",
|
||||
"COCOS_CLASSES_DIR": "frameworks/runtime-src/Classes/",
|
||||
"XCODE_PROJECT": "frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/project.pbxproj",
|
||||
"COCOSPACKAGE_DIR": "~/.cocos/package/",
|
||||
"ANDROID_STUDIO_ACTIVITY_PATH": "frameworks/runtime-src/proj.android-studio/app/src/org/cocos2dx/javascript/",
|
||||
"ANDROID_SDK_DIR": "~/sdk/",
|
||||
"COCOS_2DX_ROOT": "~/cocos2d-x-3.10",
|
||||
"PLUGIN_ROOT": "~/.cocos/package/plugins/cocospackage-multi_anysdk/",
|
||||
"COCOSPACKAGE_PUGIN_NAME": "~/.cocos/package/plugins/cocospackage-multi_anysdk/",
|
||||
"ANDROID_MANIFEST": "frameworks/runtime-src/proj.android/AndroidManifest.xml",
|
||||
"ANDROID_STUDIO_MANIFEST": "frameworks/runtime-src/proj.android-studio/app/AndroidManifest.xml",
|
||||
"ANDROID_JNI_DIR": "frameworks/runtime-src/proj.android/jni/",
|
||||
"ANDROID_ACTIVITY_NAME": "AppActivity",
|
||||
"IOS_PROJECT_DIR": "frameworks/runtime-src/proj.ios_mac/",
|
||||
"XCODE_PROJECT_CXX_LIBRARY": "libc++",
|
||||
"ANDROID_STUDIO_MK": "frameworks/runtime-src/proj.android-studio/app/jni/Android.mk",
|
||||
"PLUGIN_ANDROID_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/android/",
|
||||
"XCODE_PROJECT_DIR": "frameworks/runtime-src/proj.ios_mac/HelloJavascript.xcodeproj/",
|
||||
"COCOS_PACKAGE_DIR": "~/cocos2d-x-lite/external/package/",
|
||||
"url": "http://docs.anysdk.com/JsTutorial",
|
||||
"COCOS_PROJECT_TYPE": "js",
|
||||
"COCOS_2DX_VERSION": "3.10.0",
|
||||
"ANDROID_PROPERTIES": "frameworks/runtime-src/proj.android/project.properties",
|
||||
"PLUGIN_IOS_PATH": "~/.cocos/package/plugins/cocospackage-multi_anysdk/ios/",
|
||||
"ANDROID_ACTIVITY_PATH": "frameworks/runtime-src/proj.android/src/org/cocos2dx/javascript/",
|
||||
"android_sources": [
|
||||
"../../Classes/SDKManager.cpp",
|
||||
"../../Classes/SDKManager.cpp"
|
||||
],
|
||||
"ANDROID_MK": "frameworks/runtime-src/proj.android/jni/Android.mk",
|
||||
"ANDROID_STUDIO_LIBS_DIR": "n/a",
|
||||
"ANDROID_LIBS_DIR": "frameworks/runtime-src/proj.android/libs/",
|
||||
"COCOS_RESOURCES_DIR": "res/"
|
||||
},
|
||||
"versions": {
|
||||
"mini_cocospackage_version": "0.8.0",
|
||||
"code": "1001",
|
||||
"show_version": "2.0.1_2.2.1",
|
||||
"update_content": "2016\u5e747\u670810\u66f4\u65b0 \n 1\u3001\u6846\u67b6\u652f\u6301cocos2d-x-3.9.1 \u5f15\u64ce \n 2\u3001patchs \u6587\u4ef6\u652f\u6301cocos2d-x-3.12"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,24 @@
|
||||
"do_default":{
|
||||
"exclude_from_template":[
|
||||
"frameworks/runtime-src"
|
||||
],
|
||||
"append_dir":[
|
||||
{
|
||||
"from":"extensions/anysdk/",
|
||||
"to":"",
|
||||
"include": [
|
||||
".cocos-package.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/js-bindings/",
|
||||
"to":"frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"*.h",
|
||||
"*.cpp",
|
||||
"*.hpp"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"do_add_native_support":{
|
||||
@@ -34,10 +52,17 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/js-bindings/",
|
||||
"to":"frameworks/runtime-src/Classes",
|
||||
"include": [
|
||||
"*"
|
||||
"from":"extensions/anysdk/platform/android",
|
||||
"to":"frameworks/runtime-src/proj.android",
|
||||
"exclude": [
|
||||
"res/mipmap"
|
||||
]
|
||||
},
|
||||
{
|
||||
"from":"extensions/anysdk/platform/android",
|
||||
"to":"frameworks/runtime-src/proj.android-studio/app",
|
||||
"exclude": [
|
||||
"res/drawable"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "SDKManager.h"
|
||||
|
||||
using namespace anysdk::framework;
|
||||
|
||||
SDKManager* SDKManager::_pInstance = NULL;
|
||||
|
||||
SDKManager::SDKManager()
|
||||
{
|
||||
}
|
||||
|
||||
SDKManager::~SDKManager()
|
||||
{
|
||||
_pAgent->unloadAllPlugins();
|
||||
}
|
||||
|
||||
SDKManager* SDKManager::getInstance()
|
||||
{
|
||||
if (_pInstance == NULL) {
|
||||
_pInstance = new SDKManager();
|
||||
}
|
||||
return _pInstance;
|
||||
}
|
||||
|
||||
void SDKManager::purge()
|
||||
{
|
||||
if (_pInstance)
|
||||
{
|
||||
delete _pInstance;
|
||||
_pInstance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void SDKManager::loadAllPlugins()
|
||||
{
|
||||
/**
|
||||
* appKey, appSecret and privateKey are the only three parameters generated
|
||||
* after the packing tool client finishes creating the game.
|
||||
* The oauthLoginServer parameter is the API address provided by the game service
|
||||
* to login verification
|
||||
*/
|
||||
std::string oauthLoginServer = "OAUTH_LOGIN_SERVER";
|
||||
std::string appKey = "APP_KEY";
|
||||
std::string appSecret = "APP_SERCRET";
|
||||
std::string privateKey = "PRIVATE_KEY";
|
||||
|
||||
AgentManager* pAgent = AgentManager::getInstance();
|
||||
pAgent->init(appKey,appSecret,privateKey,oauthLoginServer);
|
||||
|
||||
//Initialize plug-ins, including SDKs.
|
||||
pAgent->loadAllPlugins();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#ifndef __SDK_MANAGER_H__
|
||||
#define __SDK_MANAGER_H__
|
||||
|
||||
#include "AgentManager.h"
|
||||
using namespace anysdk::framework;
|
||||
using namespace std;
|
||||
class SDKManager
|
||||
{
|
||||
public:
|
||||
static SDKManager* getInstance();
|
||||
static void purge();
|
||||
|
||||
void loadAllPlugins();
|
||||
|
||||
private:
|
||||
SDKManager();
|
||||
virtual ~SDKManager();
|
||||
|
||||
static SDKManager* _pInstance;
|
||||
|
||||
AgentManager* _pAgent;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<ImageView
|
||||
android:id="@+id/plugin_image_ad"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@mipmap/plugin_ui_ad" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/plugin_image_close"
|
||||
android:layout_width="20dip"
|
||||
android:layout_height="20dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@mipmap/plugin_btn_close" />
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="80dp"
|
||||
android:text="@string/plugin_login_account"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:layout_toRightOf="@id/username"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="@string/plugin_login_password"
|
||||
android:layout_below="@id/username"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_toRightOf="@id/password"
|
||||
android:layout_below="@id/txt_username"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height= "25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="@string/plugin_tips"
|
||||
android:layout_below="@id/password"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
Before Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">Account login</string>
|
||||
<string name="plugin_login_account">Account</string>
|
||||
<string name="plugin_login_password">Password</string>
|
||||
<string name="plugin_login">Login</string>
|
||||
<string name="plugin_cancel">Cancel</string>
|
||||
<string name="plugin_pay_content">Do you confirm the payment?</string>
|
||||
<string name="plugin_pay">Pay</string>
|
||||
<string name="plugin_rank">Rank</string>
|
||||
<string name="plugin_achievement">Achievement</string>
|
||||
<string name="plugin_center">Platform center</string>
|
||||
<string name="plugin_showTool">Show toolbar</string>
|
||||
<string name="plugin_hideTool">Hide toolbar</string>
|
||||
<string name="plugin_realNameRegister">Real-name registration</string>
|
||||
<string name="plugin_antiAddictionQuery">Anti-addiction query</string>
|
||||
<string name="plugin_exit">Exit</string>
|
||||
<string name="plugin_pause">Pause the game</string>
|
||||
<string name="plugin_sure">Confirm</string>
|
||||
<string name="plugin_accountSwitch">Switch account</string>
|
||||
<string name="plugin_logout">Logout</string>
|
||||
<string name="plugin_submitLoginGameRole">Submit the role information</string>
|
||||
<string name="plugin_tips">Test mode, not for official release!</string>
|
||||
<string name="plugin_waiting">Just a moment please</string>
|
||||
<string name="plugin_data">Data is communication</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">账号登陆</string>
|
||||
<string name="plugin_login_account">账号</string>
|
||||
<string name="plugin_login_password">密码</string>
|
||||
<string name="plugin_login">登陆</string>
|
||||
<string name="plugin_cancel">取消</string>
|
||||
<string name="plugin_pay_content">是否确认支付?</string>
|
||||
<string name="plugin_pay">支付</string>
|
||||
<string name="plugin_rank">排行榜</string>
|
||||
<string name="plugin_achievement">成就榜</string>
|
||||
<string name="plugin_center">平台中心</string>
|
||||
<string name="plugin_showTool">工具栏</string>
|
||||
<string name="plugin_hideTool">隐藏工具栏</string>
|
||||
<string name="plugin_realNameRegister">实名注册</string>
|
||||
<string name="plugin_antiAddictionQuery">防沉迷查询</string>
|
||||
<string name="plugin_exit">退出</string>
|
||||
<string name="plugin_pause">暂停游戏</string>
|
||||
<string name="plugin_sure">确认</string>
|
||||
<string name="plugin_accountSwitch">切换账号</string>
|
||||
<string name="plugin_logout">登出</string>
|
||||
<string name="plugin_submitLoginGameRole">提交角色信息</string>
|
||||
<string name="plugin_tips">测试模式,不能用于渠道发布</string>
|
||||
<string name="plugin_waiting">请稍等</string>
|
||||
<string name="plugin_data">数据通信中...</string>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,118 +0,0 @@
|
||||
package org.cocos2dx.javascript;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.opengl.GLSurfaceView;
|
||||
|
||||
public class SDKWrapper {
|
||||
private final static boolean PACKAGE_AS = true;
|
||||
private static Class<?> mClass = null;
|
||||
|
||||
private static SDKWrapper mInstace = null;
|
||||
public static SDKWrapper getInstance() {
|
||||
if (null == mInstace){
|
||||
mInstace = new SDKWrapper();
|
||||
try {
|
||||
String fullName = "com.anysdk.framework.PluginWrapper";
|
||||
mClass = Class.forName(fullName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return mInstace;
|
||||
}
|
||||
|
||||
public void init(Context context) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("init", Context.class).invoke(mClass, context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
SDKWrapper.nativeLoadAllPlugins();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setGLSurfaceView(GLSurfaceView view) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onResume").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onPause").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onDestroy").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewIntent(Intent intent) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onRestart() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onRestart").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onStop() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onStop").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nativeLoadAllPlugins();
|
||||
}
|
||||
|
Before Width: | Height: | Size: 463 B |
|
Before Width: | Height: | Size: 2.8 KiB |
@@ -1,24 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical" >
|
||||
<ImageView
|
||||
android:id="@+id/plugin_image_ad"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@drawable/plugin_ui_ad" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/plugin_image_close"
|
||||
android:layout_width="20dip"
|
||||
android:layout_height="20dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:src="@drawable/plugin_btn_close" />
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,62 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username"
|
||||
android:layout_height="50dp"
|
||||
android:layout_width="80dp"
|
||||
android:text="@string/plugin_login_account"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_username"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="text"
|
||||
android:layout_toRightOf="@id/username"
|
||||
android:layout_alignParentRight="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:text="@string/plugin_login_password"
|
||||
android:layout_below="@id/username"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/txt_password"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textPassword"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_toRightOf="@id/password"
|
||||
android:layout_below="@id/txt_username"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tips"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height= "25dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="@string/plugin_tips"
|
||||
android:layout_below="@id/password"
|
||||
android:textSize="18sp"
|
||||
android:textColor="#ffffff"/>
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">Account login</string>
|
||||
<string name="plugin_login_account">Account</string>
|
||||
<string name="plugin_login_password">Password</string>
|
||||
<string name="plugin_login">Login</string>
|
||||
<string name="plugin_cancel">Cancel</string>
|
||||
<string name="plugin_pay_content">Do you confirm the payment?</string>
|
||||
<string name="plugin_pay">Pay</string>
|
||||
<string name="plugin_rank">Rank</string>
|
||||
<string name="plugin_achievement">Achievement</string>
|
||||
<string name="plugin_center">Platform center</string>
|
||||
<string name="plugin_showTool">Show toolbar</string>
|
||||
<string name="plugin_hideTool">Hide toolbar</string>
|
||||
<string name="plugin_realNameRegister">Real-name registration</string>
|
||||
<string name="plugin_antiAddictionQuery">Anti-addiction query</string>
|
||||
<string name="plugin_exit">Exit</string>
|
||||
<string name="plugin_pause">Pause the game</string>
|
||||
<string name="plugin_sure">Confirm</string>
|
||||
<string name="plugin_accountSwitch">Switch account</string>
|
||||
<string name="plugin_logout">Logout</string>
|
||||
<string name="plugin_submitLoginGameRole">Submit the role information</string>
|
||||
<string name="plugin_tips">Test mode, not for official release!</string>
|
||||
<string name="plugin_waiting">Just a moment please</string>
|
||||
<string name="plugin_data">Data is communication</string>
|
||||
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="plugin_login_title">账号登陆</string>
|
||||
<string name="plugin_login_account">账号</string>
|
||||
<string name="plugin_login_password">密码</string>
|
||||
<string name="plugin_login">登陆</string>
|
||||
<string name="plugin_cancel">取消</string>
|
||||
<string name="plugin_pay_content">是否确认支付?</string>
|
||||
<string name="plugin_pay">支付</string>
|
||||
<string name="plugin_rank">排行榜</string>
|
||||
<string name="plugin_achievement">成就榜</string>
|
||||
<string name="plugin_center">平台中心</string>
|
||||
<string name="plugin_showTool">工具栏</string>
|
||||
<string name="plugin_hideTool">隐藏工具栏</string>
|
||||
<string name="plugin_realNameRegister">实名注册</string>
|
||||
<string name="plugin_antiAddictionQuery">防沉迷查询</string>
|
||||
<string name="plugin_exit">退出</string>
|
||||
<string name="plugin_pause">暂停游戏</string>
|
||||
<string name="plugin_sure">确认</string>
|
||||
<string name="plugin_accountSwitch">切换账号</string>
|
||||
<string name="plugin_logout">登出</string>
|
||||
<string name="plugin_submitLoginGameRole">提交角色信息</string>
|
||||
<string name="plugin_tips">测试模式,不能用于渠道发布</string>
|
||||
<string name="plugin_waiting">请稍等</string>
|
||||
<string name="plugin_data">数据通信中...</string>
|
||||
|
||||
|
||||
</resources>
|
||||
@@ -1,118 +0,0 @@
|
||||
package org.cocos2dx.javascript;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.opengl.GLSurfaceView;
|
||||
|
||||
public class SDKWrapper {
|
||||
private final static boolean PACKAGE_AS = true;
|
||||
private static Class<?> mClass = null;
|
||||
|
||||
private static SDKWrapper mInstace = null;
|
||||
public static SDKWrapper getInstance() {
|
||||
if (null == mInstace){
|
||||
mInstace = new SDKWrapper();
|
||||
try {
|
||||
String fullName = "com.anysdk.framework.PluginWrapper";
|
||||
mClass = Class.forName(fullName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return mInstace;
|
||||
}
|
||||
|
||||
public void init(Context context) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("init", Context.class).invoke(mClass, context);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
SDKWrapper.nativeLoadAllPlugins();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setGLSurfaceView(GLSurfaceView view) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("setGLSurfaceView", GLSurfaceView.class).invoke(mClass, view);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onResume() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onResume").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onPause").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onDestroy").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onActivityResult", int.class, int.class, Intent.class).invoke(mClass, requestCode, resultCode, data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onNewIntent(Intent intent) {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onNewIntent", Intent.class).invoke(mClass, intent);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onRestart() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onRestart").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onStop() {
|
||||
if (PACKAGE_AS) {
|
||||
try {
|
||||
mClass.getMethod("onStop").invoke(mClass);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static native void nativeLoadAllPlugins();
|
||||
}
|
||||
@@ -1,226 +0,0 @@
|
||||
anysdk.agentManager = anysdk.AgentManager.getInstance();
|
||||
|
||||
anysdk.callWrapper = function(plugin, func){
|
||||
plugin[func.name] = (function(){
|
||||
var params = [];
|
||||
if(arguments){
|
||||
var l = arguments.length;
|
||||
for (var i = 0; i < l; i++) {
|
||||
var arg = arguments[i];
|
||||
var param = anysdk.PluginParam.create(arg);
|
||||
params.push(param);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.returnType == "void"){
|
||||
plugin.callFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "boolean"){
|
||||
return plugin.callBoolFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "int"){
|
||||
return plugin.callIntFuncWithParam(this.name, params);
|
||||
}else if(this.returnType == "float"){
|
||||
return plugin.callFloatFuncWithParam(this.name, params);
|
||||
}else {
|
||||
return plugin.callStringFuncWithParam(this.name, params);
|
||||
}
|
||||
}).bind(func);
|
||||
}
|
||||
|
||||
anysdk.parseData = function(data){
|
||||
var jsonData = [];
|
||||
var substring = data.substring(1, data.length - 2)
|
||||
var array = substring.split(",");
|
||||
for (var i = 0; i < array.length; i++ ){
|
||||
var functionData = array[i].split("&");
|
||||
var funcParam = {};
|
||||
for(var j = 0; j < functionData.length; j++){
|
||||
var itemData = functionData[j].split("=");
|
||||
if(itemData.length > 1)
|
||||
{
|
||||
funcParam[itemData[0]] = itemData[1];
|
||||
}
|
||||
}
|
||||
jsonData.push(funcParam)
|
||||
|
||||
}
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
anysdk.registerAPIs = function(plugin) {
|
||||
var functionString = anysdk.JSBRelation.getMethodsOfPlugin(plugin);
|
||||
var data = anysdk.parseData(functionString);
|
||||
for (var i = 0; i < data.length; i++ ){
|
||||
var name = data[i].name;
|
||||
if(name && !plugin[name]){
|
||||
cc.log("plugin: " + name + " auto binding");
|
||||
anysdk.callWrapper(plugin, data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
anysdk.agentManager._loadAllPlugins = anysdk.agentManager.loadAllPlugins;
|
||||
anysdk.agentManager.loadAllPlugins = function (callback, target) {
|
||||
anysdk.agentManager._loadAllPlugins();
|
||||
if(callback){
|
||||
if (target){
|
||||
callback.call(target, 0, "loadAllPlugins finish");
|
||||
}else{
|
||||
callback(0, "loadAllPlugins finish");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anysdk.agentManager._getUserPlugin = anysdk.agentManager.getUserPlugin;
|
||||
anysdk.agentManager.getUserPlugin = function () {
|
||||
var plugin = this._getUserPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
plugin.setListener = function(callback, target){
|
||||
var onUserResult = function(plugin, code, msg){
|
||||
if (target){
|
||||
callback.call(target, code, msg);
|
||||
}else{
|
||||
callback(code, msg);
|
||||
}
|
||||
}
|
||||
plugin.setActionListener(onUserResult,this);
|
||||
};
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getIAPPlugin = anysdk.agentManager.getIAPPlugin;
|
||||
anysdk.agentManager.getIAPPlugins = function () {
|
||||
var plugins = this._getIAPPlugin();
|
||||
if (plugins) {
|
||||
for (var item in plugins){
|
||||
if (plugins.hasOwnProperty(item)){
|
||||
var plugin = plugins[item];
|
||||
if (!plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
return plugins;
|
||||
}
|
||||
|
||||
anysdk.agentManager.getIAPPlugin = function () {
|
||||
var iapPlugins = anysdk.agentManager.getIAPPlugins();
|
||||
if(iapPlugins != null){
|
||||
for(var item in iapPlugins){
|
||||
if (iapPlugins.hasOwnProperty(item)) {
|
||||
return iapPlugins[item];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
anysdk.agentManager._getAdsPlugin = anysdk.agentManager.getAdsPlugin;
|
||||
anysdk.agentManager.getAdsPlugin = function () {
|
||||
var plugin = this._getAdsPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setAdsListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getSocialPlugin = anysdk.agentManager.getSocialPlugin;
|
||||
anysdk.agentManager.getSocialPlugin = function () {
|
||||
var plugin = this._getSocialPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getSharePlugin = anysdk.agentManager.getSharePlugin;
|
||||
anysdk.agentManager.getSharePlugin = function () {
|
||||
var plugin = this._getSharePlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getPushPlugin = anysdk.agentManager.getPushPlugin;
|
||||
anysdk.agentManager.getPushPlugin = function () {
|
||||
var plugin = this._getPushPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setActionListener;
|
||||
plugin.isInitialized = true;
|
||||
plugin.setListener = function(callback, target){
|
||||
var onPushResult = function(plugin, code, msg){
|
||||
if (target){
|
||||
callback.call(target, code, msg);
|
||||
}else{
|
||||
callback(code, msg);
|
||||
}
|
||||
}
|
||||
plugin.setActionListener(onPushResult,this);
|
||||
};
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getAnalyticsPlugin = anysdk.agentManager.getAnalyticsPlugin;
|
||||
anysdk.agentManager.getAnalyticsPlugin = function () {
|
||||
var plugin = this._getAnalyticsPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getRECPlugin = anysdk.agentManager.getRECPlugin;
|
||||
anysdk.agentManager.getRECPlugin = function () {
|
||||
var plugin = this._getRECPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getCustomPlugin = anysdk.agentManager.getCustomPlugin;
|
||||
anysdk.agentManager.getCustomPlugin = function () {
|
||||
var plugin = this._getCustomPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.setListener = plugin.setResultListener;
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getCrashPlugin = anysdk.agentManager.getCrashPlugin;
|
||||
anysdk.agentManager.getCrashPlugin = function () {
|
||||
var plugin = this._getCrashPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
|
||||
anysdk.agentManager._getAdTrackingPlugin = anysdk.agentManager.getAdTrackingPlugin;
|
||||
anysdk.agentManager.getAdTrackingPlugin = function () {
|
||||
var plugin = this._getAdTrackingPlugin();
|
||||
if (plugin && !plugin.isInitialized) {
|
||||
anysdk.registerAPIs(plugin);
|
||||
plugin.isInitialized = true;
|
||||
}
|
||||
return plugin;
|
||||
}
|
||||
@@ -1,403 +0,0 @@
|
||||
//for plugin type
|
||||
anysdk.PluginType = {
|
||||
kPluginAds:16,/**< enum value is the type of Ads. */
|
||||
kPluginAnalytics:1,/**< enum value is the type of Analytics. */
|
||||
kPluginIAP:8,/**< enum value is the type of IAP. */
|
||||
kPluginShare:2,/**< enum value is the type of Share. */
|
||||
kPluginUser:32,/**< enum value is the type of User. */
|
||||
kPluginSocial:4,/**< enum value is the type of Social. */
|
||||
kPluginPush:64,/**< enum value is the type of Push. */
|
||||
kPluginCrash:128,/**< enum value is the type of Crash. */
|
||||
kPluginCustom:256,/**< enum value is the type of Custom. */
|
||||
kPluginREC:512,/**< enum value is the type of REC. */
|
||||
kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
|
||||
|
||||
}; //plugin type
|
||||
|
||||
//for Custom
|
||||
anysdk.CustomResultCode = {
|
||||
kCustomExtension:80000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
anysdk.RECResultCode = {
|
||||
kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
|
||||
kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
|
||||
kRECStartRecording:2,/**< enum value is callback of starting to record. */
|
||||
kRECStopRecording:3,/**< enum value is callback of stoping to record. */
|
||||
kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
|
||||
kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
|
||||
kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
|
||||
kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
|
||||
kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
|
||||
kRECShareFail:9,/**< enum value is callback of failing to share. */
|
||||
kRECExtension:90000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
//for ads
|
||||
anysdk.AdsResultCode = {
|
||||
kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
|
||||
kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
|
||||
kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
|
||||
kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
|
||||
kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
|
||||
kNetworkError:5, /**< enum the callback of Network error at center. */
|
||||
kUnknownError:6, /**< enum the callback of Unknown error. */
|
||||
kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
|
||||
kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
|
||||
kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
|
||||
kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
|
||||
kAdsExtension :40000 /**< enum value is extension code . */
|
||||
}; //ads result code
|
||||
|
||||
anysdk.AdsPos = {
|
||||
kPosCenter:0, /**< enum the toolbar is at center. */
|
||||
kPosTop:1, /**< enum the toolbar is at top. */
|
||||
kPosTopLeft:2, /**< enum the toolbar is at topleft. */
|
||||
kPosTopRight:3, /**< enum the toolbar is at topright. */
|
||||
kPosBottom:4, /**< enum the toolbar is at bottom. */
|
||||
kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
}; //ads pos
|
||||
|
||||
anysdk.AdsType = {
|
||||
AD_TYPE_BANNER:0, /**< enum value is banner ads . */
|
||||
AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
|
||||
AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
|
||||
AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
|
||||
AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
|
||||
AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
|
||||
AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
|
||||
}; //ads type
|
||||
|
||||
//for pay result code
|
||||
anysdk.PayResultCode = {
|
||||
kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
|
||||
kPayFail:1, /**< enum value is callback of failing to pay . */
|
||||
kPayCancel:2, /**< enum value is callback of canceling to pay . */
|
||||
kPayNetworkError:3, /**< enum value is callback of network error . */
|
||||
kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
|
||||
kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
|
||||
kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
|
||||
kPayNowPaying:7, /**< enum value is callback of paying now . */
|
||||
kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
|
||||
kPayExtension : 30000, /**< enum value is extension code . */
|
||||
kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
|
||||
};
|
||||
|
||||
anysdk.RequestResultCode = {
|
||||
kRequestSuccess:31000, /**<enum value is callback of succeeding in paying . */
|
||||
kRequestFail:31001 /**<enum value is callback of failing to pay . */
|
||||
};
|
||||
|
||||
// for push action result code
|
||||
anysdk.PushActionResultCode = {
|
||||
kPushReceiveMessage:0, /**value is callback of Receiving Message . */
|
||||
kPushExtensionCode : 60000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
// for share result code
|
||||
anysdk.ShareResultCode = {
|
||||
kShareSuccess:0, /**< enum value is callback of failing to sharing . */
|
||||
kShareFail:1, /**< enum value is callback of failing to share . */
|
||||
kShareCancel:2, /**< enum value is callback of canceling to share . */
|
||||
kShareNetworkError:3, /**< enum value is callback of network error . */
|
||||
kShareExtension :10000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
//for social ret code
|
||||
anysdk.SocialRetCode = {
|
||||
// code for leaderboard feature
|
||||
kScoreSubmitSucceed:1, /**< enum value is callback of succeeding in submiting. */
|
||||
kScoreSubmitfail:2, /**< enum value is callback of failing to submit . */
|
||||
// code for achievement feature
|
||||
kAchUnlockSucceed:3, /**< enum value is callback of succeeding in unlocking. */
|
||||
kAchUnlockFail:4, /**< enum value is callback of failing to unlock. */
|
||||
kSocialSignInSucceed:5, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignInFail:6, /**< enum value is callback of failing to login. */
|
||||
kSocialSignOutSucceed:7, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignOutFail:8, /**< enum value is callback of failing to login. */
|
||||
kSocialGetGameFriends:9, /**< enum value is callback of failing to login. */
|
||||
kSocialExtensionCode :20000, /**< enum value is extension code . */
|
||||
kSocialGetFriendsInfoSuccess: 21001, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kSocialGetFriendsInfoFail: 21002, /**< enum value is callback of failing in getting user info. */
|
||||
kSocialAlreadySubscription: 21003, /**< enum value is callback of subscription . */
|
||||
kSocialNoSubscription: 21004, /**< enum value is callback No subscription. */
|
||||
kSocialSubscriptionFail: 21005, /**< enum value is callback of failing in subscription . */
|
||||
};
|
||||
|
||||
// for user action result code
|
||||
anysdk.UserActionResultCode = {
|
||||
kInitSuccess:0, /**< enum value is callback of succeeding in initing sdk. */
|
||||
kInitFail:1, /**< enum value is callback of failing to init sdk. */
|
||||
kLoginSuccess:2, /**< enum value is callback of succeeding in login.*/
|
||||
kLoginNetworkError:3, /**< enum value is callback of network error*/
|
||||
kLoginNoNeed:4, /**< enum value is callback of no need login.*/
|
||||
kLoginFail:5, /**< enum value is callback of failing to login. */
|
||||
kLoginCancel:6, /**< enum value is callback of canceling to login. */
|
||||
kLogoutSuccess:7, /**< enum value is callback of succeeding in logout. */
|
||||
kLogoutFail:8, /**< enum value is callback of failing to logout. */
|
||||
kPlatformEnter:9, /**< enum value is callback after enter platform. */
|
||||
kPlatformBack:10, /**< enum value is callback after exit antiAddiction. */
|
||||
kPausePage:11, /**< enum value is callback after exit pause page. */
|
||||
kExitPage:12, /**< enum value is callback after exit exit page. */
|
||||
kAntiAddictionQuery:13, /**< enum value is callback after querying antiAddiction. */
|
||||
kRealNameRegister:14, /**< enum value is callback after registering realname. */
|
||||
kAccountSwitchSuccess:15, /**< enum alue is callback of succeeding in switching account. */
|
||||
kAccountSwitchFail:16, /**< enum value is callback of failing to switch account. */
|
||||
kOpenShop:17 , /**< enum value is callback of open the shop. */
|
||||
kAccountSwitchCancel:18,/**< enum value is callback of canceling to switch account. */
|
||||
kUserExtension: 50000, /**< enum value is extension code . */
|
||||
kSendToDesktopSuccess: 51001, /**< enum value is callback of succeeding in sending to desktop. */
|
||||
kSendToDesktopFail: 51002, /**< enum value is callback of failing in sending to desktop. */
|
||||
kGetAvailableLoginTypeSuccess: 51003,/**< enum value is callback of succeeding in getting available login type. */
|
||||
kGetAvailableLoginTypeFail: 51004 ,/**< enum value is callback of failing in getting available login type. */
|
||||
kGetUserInfoSuccess: 51005, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kGetUserInfoFail: 51006 ,/**< enum value is callback of failing in getting user info. */
|
||||
kOpenBBSSuccess: 51007, /**< enum value is callback of succeeding in opening BBS.*/
|
||||
kOpenBBSFail: 51008 /**< enum value is callback of failing in opening BBS. */
|
||||
|
||||
};
|
||||
|
||||
//for toolBar place
|
||||
anysdk.ToolBarPlace = {
|
||||
kToolBarTopLeft:1, /**< enum the toolbar is at topleft. */
|
||||
kToolBarTopRight:2, /**< enum the toolbar is at topright. */
|
||||
kToolBarMidLeft:3, /**< enum the toolbar is at midleft. */
|
||||
kToolBarMidRight:4, /**< enum the toolbar is at midright. */
|
||||
kToolBarBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kToolBarBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
};
|
||||
|
||||
|
||||
//for analytics
|
||||
anysdk.AccountType = {
|
||||
ANONYMOUS:0,/**< enum value is anonymous typek. */
|
||||
REGISTED:1,/**< enum value is registed type. */
|
||||
SINA_WEIBO:2,/**< enum value is sineweibo type. */
|
||||
TENCENT_WEIBO:3,/**< enum value is tecentweibo type */
|
||||
QQ:4,/**< enum value is qq type */
|
||||
ND91:5/**< enum value is nd91 type. */
|
||||
};
|
||||
|
||||
anysdk.AccountOperate = {
|
||||
LOGIN:0,/**< enum value is the login operate. */
|
||||
LOGOUT:1,/**< enum value is the logout operate. */
|
||||
REGISTER:2/**< enum value is the register operate. */
|
||||
};
|
||||
|
||||
anysdk.AccountGender = {
|
||||
MALE:0,/**< enum value is male. */
|
||||
FEMALE:1,/**< enum value is female. */
|
||||
UNKNOWN:2/**< enum value is unknow. */
|
||||
};
|
||||
|
||||
anysdk.TaskType = {
|
||||
GUIDE_LINE:0,/**< enum value is the guideline type.. */
|
||||
MAIN_LINE:1,/**< enum value is the mainline type.. */
|
||||
BRANCH_LINE:2,/**<enum value is the branchline type.. */
|
||||
DAILY:3,/**< enum value is the daily type.. */
|
||||
ACTIVITY:4,/**< enum value is the activity type. */
|
||||
OTHER:5/**< enum value is other type. */
|
||||
};
|
||||
//end analytics
|
||||
|
||||
//for plugin type
|
||||
var PluginType = {
|
||||
kPluginAds:16,/**< enum value is the type of Ads. */
|
||||
kPluginAnalytics:1,/**< enum value is the type of Analytics. */
|
||||
kPluginIAP:8,/**< enum value is the type of IAP. */
|
||||
kPluginShare:2,/**< enum value is the type of Share. */
|
||||
kPluginUser:32,/**< enum value is the type of User. */
|
||||
kPluginSocial:4,/**< enum value is the type of Social. */
|
||||
kPluginPush:64,/**< enum value is the type of Push. */
|
||||
kPluginCrash:128,/**< enum value is the type of Crash. */
|
||||
kPluginCustom:256,/**< enum value is the type of Custom. */
|
||||
kPluginREC:512,/**< enum value is the type of REC. */
|
||||
kPluginAdTracking:1024/**< enum value is the type of AdTracking. */
|
||||
}; //plugin type
|
||||
|
||||
//for Custom
|
||||
var CustomResultCode = {
|
||||
kCustomExtension:80000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
var RECResultCode = {
|
||||
kRECInitSuccess:0,/**< enum value is callback of succeeding in initing sdk . */
|
||||
kRECInitFail:1,/**< enum value is callback of failing to init sdk. */
|
||||
kRECStartRecording:2,/**< enum value is callback of starting to record. */
|
||||
kRECStopRecording:3,/**< enum value is callback of stoping to record. */
|
||||
kRECPauseRecording:4,/**< enum value is callback of pausing to record. */
|
||||
kRECResumeRecording:5,/**< enum value is callback of resuming to record. */
|
||||
kRECEnterSDKPage:6,/**< enum value is callback of failing to init sdk. */
|
||||
kRECQuitSDKPage:7,/**< enum value is callback of entering SDK`s page. */
|
||||
kRECShareSuccess:8,/**< enum value is callback of quiting SDK`s page. */
|
||||
kRECShareFail:9,/**< enum value is callback of failing to share. */
|
||||
kRECExtension:90000 /**< enum value is extension code . */
|
||||
} ;
|
||||
|
||||
//for ads
|
||||
var AdsResultCode = {
|
||||
kAdsReceived:0, /**< enum the callback: the ad is received is at center. */
|
||||
kAdsShown:1, /**< enum the callback: the advertisement dismissed. */
|
||||
kAdsDismissed:2, /**< enum the callback: the advertisement dismissed. */
|
||||
kPointsSpendSucceed:3, /**< enum the callback: the points spend succeed. */
|
||||
kPointsSpendFailed:4, /**< enum the callback: the points spend failed. */
|
||||
kNetworkError:5, /**< enum the callback of Network error at center. */
|
||||
kUnknownError:6, /**< enum the callback of Unknown error. */
|
||||
kOfferWallOnPointsChanged:7, /**< enum the callback of Changing the point of offerwall. */
|
||||
kRewardedVideoWithReward:8,/**< enum the callback of receive the reward of rewardedvideo. */
|
||||
kInAppPurchaseFinished:9,/**< enum the callback of finishing IAP ad. */
|
||||
kAdsClicked:10,/**< enum the callback of the advertisement clicked. */
|
||||
kAdsExtension :40000 /**< enum value is extension code . */
|
||||
}; //ads result code
|
||||
|
||||
var AdsPos = {
|
||||
kPosCenter:0, /**< enum the toolbar is at center. */
|
||||
kPosTop:1, /**< enum the toolbar is at top. */
|
||||
kPosTopLeft:2, /**< enum the toolbar is at topleft. */
|
||||
kPosTopRight:3, /**< enum the toolbar is at topright. */
|
||||
kPosBottom:4, /**< enum the toolbar is at bottom. */
|
||||
kPosBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kPosBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
}; //ads pos
|
||||
|
||||
var AdsType = {
|
||||
AD_TYPE_BANNER:0, /**< enum value is banner ads . */
|
||||
AD_TYPE_FULLSCREEN:1, /**< enum value is fullscreen ads . */
|
||||
AD_TYPE_MOREAPP:2, /**< enum value is moreapp ads . */
|
||||
AD_TYPE_OFFERWALL:3, /**< enum value is offerwall ads . */
|
||||
AD_TYPE_REWARDEDVIDEO:4,/**< enum value is rewarded video ads . */
|
||||
AD_TYPE_NATIVEEXPRESS:5,/**< enum value is Native express ads . */
|
||||
AD_TYPE_NATIVEADVANCED:6/**< enum value is Native advanced ads . */
|
||||
}; //ads type
|
||||
|
||||
//for pay result code
|
||||
var PayResultCode = {
|
||||
kPaySuccess:0, /**< enum value is callback of succeeding in paying . */
|
||||
kPayFail:1, /**< enum value is callback of failing to pay . */
|
||||
kPayCancel:2, /**< enum value is callback of canceling to pay . */
|
||||
kPayNetworkError:3, /**< enum value is callback of network error . */
|
||||
kPayProductionInforIncomplete:4, /**< enum value is callback of incompleting info . */
|
||||
kPayInitSuccess:5, /**< enum value is callback of succeeding in initing sdk . */
|
||||
kPayInitFail:6, /**< enum value is callback of failing to init sdk . */
|
||||
kPayNowPaying:7, /**< enum value is callback of paying now . */
|
||||
kPayRechargeSuccess:8,/**< enum value is callback of succeeding in recharging. */
|
||||
kPayExtension : 30000, /**< enum value is extension code . */
|
||||
kPayNeedLoginAgain : 31002 /**< enum value is callback of logining again . */
|
||||
};
|
||||
|
||||
var RequestResultCode = {
|
||||
kRequestSuccess:31000, /**<enum value is callback of succeeding in paying . */
|
||||
kRequestFail:31001 /**<enum value is callback of failing to pay . */
|
||||
};
|
||||
|
||||
// for push action result code
|
||||
var PushActionResultCode = {
|
||||
kPushReceiveMessage:0, /**value is callback of Receiving Message . */
|
||||
kPushExtensionCode : 60000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
// for share result code
|
||||
var ShareResultCode = {
|
||||
kShareSuccess:0, /**< enum value is callback of failing to sharing . */
|
||||
kShareFail:1, /**< enum value is callback of failing to share . */
|
||||
kShareCancel:2, /**< enum value is callback of canceling to share . */
|
||||
kShareNetworkError:3, /**< enum value is callback of network error . */
|
||||
kShareExtension :10000 /**< enum value is extension code . */
|
||||
};
|
||||
|
||||
//for social ret code
|
||||
var SocialRetCode = {
|
||||
// code for leaderboard feature
|
||||
kScoreSubmitSucceed:1, /**< enum value is callback of succeeding in submiting. */
|
||||
kScoreSubmitfail:2, /**< enum value is callback of failing to submit . */
|
||||
// code for achievement feature
|
||||
kAchUnlockSucceed:3, /**< enum value is callback of succeeding in unlocking. */
|
||||
kAchUnlockFail:4, /**< enum value is callback of failing to unlock. */
|
||||
kSocialSignInSucceed:5, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignInFail:6, /**< enum value is callback of failing to login. */
|
||||
kSocialSignOutSucceed:7, /**< enum value is callback of succeeding to login. */
|
||||
kSocialSignOutFail:8, /**< enum value is callback of failing to login. */
|
||||
kSocialGetGameFriends:9, /**< enum value is callback of failing to login. */
|
||||
kSocialExtensionCode :20000, /**< enum value is extension code . */
|
||||
kSocialGetFriendsInfoSuccess: 21001, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kSocialGetFriendsInfoFail: 21002, /**< enum value is callback of failing in getting user info. */
|
||||
kSocialAlreadySubscription: 21003, /**< enum value is callback of subscription . */
|
||||
kSocialNoSubscription: 21004, /**< enum value is callback No subscription. */
|
||||
kSocialSubscriptionFail: 21005, /**< enum value is callback of failing in subscription . */
|
||||
};
|
||||
|
||||
// for user action result code
|
||||
var UserActionResultCode = {
|
||||
kInitSuccess:0, /**< enum value is callback of succeeding in initing sdk. */
|
||||
kInitFail:1, /**< enum value is callback of failing to init sdk. */
|
||||
kLoginSuccess:2, /**< enum value is callback of succeeding in login.*/
|
||||
kLoginNetworkError:3, /**< enum value is callback of network error*/
|
||||
kLoginNoNeed:4, /**< enum value is callback of no need login.*/
|
||||
kLoginFail:5, /**< enum value is callback of failing to login. */
|
||||
kLoginCancel:6, /**< enum value is callback of canceling to login. */
|
||||
kLogoutSuccess:7, /**< enum value is callback of succeeding in logout. */
|
||||
kLogoutFail:8, /**< enum value is callback of failing to logout. */
|
||||
kPlatformEnter:9, /**< enum value is callback after enter platform. */
|
||||
kPlatformBack:10, /**< enum value is callback after exit antiAddiction. */
|
||||
kPausePage:11, /**< enum value is callback after exit pause page. */
|
||||
kExitPage:12, /**< enum value is callback after exit exit page. */
|
||||
kAntiAddictionQuery:13, /**< enum value is callback after querying antiAddiction. */
|
||||
kRealNameRegister:14, /**< enum value is callback after registering realname. */
|
||||
kAccountSwitchSuccess:15, /**< enum alue is callback of succeeding in switching account. */
|
||||
kAccountSwitchFail:16, /**< enum value is callback of failing to switch account. */
|
||||
kOpenShop:17 , /**< enum value is callback of open the shop. */
|
||||
kAccountSwitchCancel:18,/**< enum value is callback of canceling to switch account. */
|
||||
kUserExtension: 50000, /**< enum value is extension code . */
|
||||
kSendToDesktopSuccess: 51001, /**< enum value is callback of succeeding in sending to desktop. */
|
||||
kSendToDesktopFail: 51002, /**< enum value is callback of failing in sending to desktop. */
|
||||
kGetAvailableLoginTypeSuccess: 51003,/**< enum value is callback of succeeding in getting available login type. */
|
||||
kGetAvailableLoginTypeFail: 51004 ,/**< enum value is callback of failing in getting available login type. */
|
||||
kGetUserInfoSuccess: 51005, /**< enum value is callback of succeeding in getting user info.*/
|
||||
kGetUserInfoFail: 51006 ,/**< enum value is callback of failing in getting user info. */
|
||||
kOpenBBSSuccess: 51007, /**< enum value is callback of succeeding in opening BBS.*/
|
||||
kOpenBBSFail: 51008 /**< enum value is callback of failing in opening BBS. */
|
||||
};
|
||||
|
||||
//for toolBar place
|
||||
var ToolBarPlace = {
|
||||
kToolBarTopLeft:1, /**< enum the toolbar is at topleft. */
|
||||
kToolBarTopRight:2, /**< enum the toolbar is at topright. */
|
||||
kToolBarMidLeft:3, /**< enum the toolbar is at midleft. */
|
||||
kToolBarMidRight:4, /**< enum the toolbar is at midright. */
|
||||
kToolBarBottomLeft:5, /**< enum the toolbar is at bottomleft. */
|
||||
kToolBarBottomRight:6 /**< enum the toolbar is at bottomright. */
|
||||
};
|
||||
|
||||
|
||||
//for analytics
|
||||
var AccountType = {
|
||||
ANONYMOUS:0,/**< enum value is anonymous typek. */
|
||||
REGISTED:1,/**< enum value is registed type. */
|
||||
SINA_WEIBO:2,/**< enum value is sineweibo type. */
|
||||
TENCENT_WEIBO:3,/**< enum value is tecentweibo type */
|
||||
QQ:4,/**< enum value is qq type */
|
||||
ND91:5/**< enum value is nd91 type. */
|
||||
};
|
||||
|
||||
var AccountOperate = {
|
||||
LOGIN:0,/**< enum value is the login operate. */
|
||||
LOGOUT:1,/**< enum value is the logout operate. */
|
||||
REGISTER:2/**< enum value is the register operate. */
|
||||
};
|
||||
|
||||
var AccountGender = {
|
||||
MALE:0,/**< enum value is male. */
|
||||
FEMALE:1,/**< enum value is female. */
|
||||
UNKNOWN:2/**< enum value is unknow. */
|
||||
};
|
||||
|
||||
var TaskType = {
|
||||
GUIDE_LINE:0,/**< enum value is the guideline type.. */
|
||||
MAIN_LINE:1,/**< enum value is the mainline type.. */
|
||||
BRANCH_LINE:2,/**<enum value is the branchline type.. */
|
||||
DAILY:3,/**< enum value is the daily type.. */
|
||||
ACTIVITY:4,/**< enum value is the activity type. */
|
||||
OTHER:5/**< enum value is other type. */
|
||||
};
|
||||
//end analytics
|
||||