add anysdk jailbreak files
This commit is contained in:
parent
b43a5b345b
commit
68a541de06
|
|
@ -0,0 +1,20 @@
|
||||||
|
//
|
||||||
|
// AdsUtil.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-9-23.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@interface AdsUtil : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the parameters of ads system in special case
|
||||||
|
*
|
||||||
|
* @return return the parameters
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*)getAdsParams;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
//
|
||||||
|
// AdsWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-8-29.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
RESULT_CODE_AdsReceived = 0, // The ad is received
|
||||||
|
RESULT_CODE_AdsShown, // The advertisement shown
|
||||||
|
RESULT_CODE_AdsDismissed, // The advertisement
|
||||||
|
// dismissed
|
||||||
|
RESULT_CODE_PointsSpendSucceed, // The points
|
||||||
|
// spend succeed
|
||||||
|
RESULT_CODE_PointsSpendFailed, // The points
|
||||||
|
// spend failed
|
||||||
|
RESULT_CODE_NetworkError, // Network error
|
||||||
|
RESULT_CODE_UnknownError, // Unknown error
|
||||||
|
RESULT_CODE_OfferWallOnPointsChanged, // Change the point of offerwall
|
||||||
|
RESULT_CODE_RewardedVideoWithReward,//the callback of receiving the reward of rewardedvideo
|
||||||
|
RESULT_CODE_InAppPurchaseFinished,////the callback of finishing YAP ad
|
||||||
|
RESULT_CODE_AdsClicked, //the callback of the advertisement clicked
|
||||||
|
RESULT_CODE_ADSEXTENSION = 40000 //ads extension code
|
||||||
|
|
||||||
|
}AD_RET_CODE;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
||||||
|
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
||||||
|
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
||||||
|
AD_TYPE_OFFERWALL, /**< enum value is offerwall ads . */
|
||||||
|
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
||||||
|
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
||||||
|
AD_TYPE_NATIVEADVANCED/**< enum value is Native advanced ads . */
|
||||||
|
} ADS_TYPE;
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
POS_CENTER = 0,/**< enum the toolbar is at center. */
|
||||||
|
POS_TOP,/**< enum the toolbar is at top. */
|
||||||
|
POS_TOP_LEFT,/**< enum the toolbar is at topleft. */
|
||||||
|
POS_TOP_RIGHT,/**< enum the toolbar is at topright. */
|
||||||
|
POS_BOTTOM,/**< enum the toolbar is at bottom. */
|
||||||
|
POS_BOTTOM_LEFT,/**< enum the toolbar is at bottomleft. */
|
||||||
|
POS_BOTTOM_RIGHT/**< enum the toolbar is at bottomright. */
|
||||||
|
|
||||||
|
}AD_POS;
|
||||||
|
|
||||||
|
@interface AdsWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get current RootViewController
|
||||||
|
*
|
||||||
|
* @return RootViewController
|
||||||
|
*/
|
||||||
|
+ (UIViewController *)getCurrentRootViewController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get top window
|
||||||
|
*
|
||||||
|
* @return return top window
|
||||||
|
*/
|
||||||
|
+ (UIWindow*) getTopWindow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback interface of yap system
|
||||||
|
*
|
||||||
|
* @param pPlugin the yap plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void)onAdsResult:(id)target retCode:(int)code msg:(NSString*)msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* add ad view
|
||||||
|
*
|
||||||
|
* @param view view
|
||||||
|
* @param pos position
|
||||||
|
*/
|
||||||
|
+ (void) addAdView:(UIView*) view atPos:(AD_POS) pos;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the name of the advertising types
|
||||||
|
*
|
||||||
|
* @param adType the type of the advertising
|
||||||
|
*
|
||||||
|
* @return the name of the advertising types
|
||||||
|
*/
|
||||||
|
+ (NSString*)getAdNameWithType:(int)adType;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,269 @@
|
||||||
|
/** @file AgentManager.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __CCX_AGENTMANAGER_H__
|
||||||
|
#define __CCX_AGENTMANAGER_H__
|
||||||
|
|
||||||
|
#include "PluginManager.h"
|
||||||
|
#include "ProtocolYAP.h"
|
||||||
|
#include "ProtocolAnalytics.h"
|
||||||
|
#include "ProtocolShare.h"
|
||||||
|
#include "ProtocolAds.h"
|
||||||
|
#include "ProtocolSocial.h"
|
||||||
|
#include "ProtocolUser.h"
|
||||||
|
#include "ProtocolPush.h"
|
||||||
|
#include "ProtocolCrash.h"
|
||||||
|
#include "ProtocolREC.h"
|
||||||
|
#include "ProtocolCustom.h"
|
||||||
|
#include "ProtocolAdTracking.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#define ProtocolIAP ProtocolYAP
|
||||||
|
#define getIAPPlugin getYAPPlugin
|
||||||
|
#define kPluginIAP kPluginYAP
|
||||||
|
#define onPay onYap
|
||||||
|
#define kPaySuccess kYapSuccess
|
||||||
|
#define kPayFail kYapFail
|
||||||
|
#define kPayCancel kPayCancel
|
||||||
|
#define kPayNetworkError kPayNetworkError
|
||||||
|
#define kPayProductionInforIncomplete kYapProductionInforIncomplete
|
||||||
|
#define kPayInitSuccess kYapInitSuccess
|
||||||
|
#define kPayInitFail kYapInitFail
|
||||||
|
#define kPayNowPaying kYapNowYaping
|
||||||
|
#define kPayRechargeSuccess kYapYapSuccess
|
||||||
|
#define kPayExtension kYapExtension
|
||||||
|
#define PayResultCode YapResultCode
|
||||||
|
#define resetPayState resetYapState
|
||||||
|
#define getPayListener getYapListener
|
||||||
|
#define payForProduct yapForProduct
|
||||||
|
#define onPayResult onYapResult
|
||||||
|
#define PayResultListener YapResultListener
|
||||||
|
#define kPayCancel kYapCancel
|
||||||
|
#define kPayNetworkError kYapNetworkError
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/** @brief Plugin_type enum, with inline docs */
|
||||||
|
typedef enum {
|
||||||
|
kPluginAds = 16,/**< enum value is the type of Ads. */
|
||||||
|
kPluginAnalytics = 1,/**< enum value is the type of Analytics. */
|
||||||
|
kPluginYAP = 8,/**< enum value is the type of YAP. */
|
||||||
|
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;
|
||||||
|
/**
|
||||||
|
* @class AgentManager
|
||||||
|
*/
|
||||||
|
class AgentManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~AgentManager();
|
||||||
|
/**
|
||||||
|
@brief Get singleton of AgentManager
|
||||||
|
*/
|
||||||
|
|
||||||
|
static AgentManager* getInstance();
|
||||||
|
/**
|
||||||
|
@brief Destory the instance of AgentManager
|
||||||
|
*/
|
||||||
|
static void end();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@breif the init of AgentManager
|
||||||
|
@param the appKey of anysdk
|
||||||
|
@param the appSecret of anysdk
|
||||||
|
@param the privateKey of anysdk
|
||||||
|
@param the url of oauthLoginServer
|
||||||
|
@warning Must invoke this interface before loadAllPlugins
|
||||||
|
*/
|
||||||
|
void init(std::string appKey,std::string appSecret,std::string privateKey,std::string oauthLoginServer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief load the plugins
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE void loadALLPlugin();
|
||||||
|
/**
|
||||||
|
@brief unload the plugins
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE void unloadALLPlugin();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief load the plugins
|
||||||
|
*/
|
||||||
|
void loadAllPlugins();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief unload the plugins
|
||||||
|
*/
|
||||||
|
void unloadAllPlugins();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Analytics plugin
|
||||||
|
@return if Analytics plugin exist ,return value is Analytics plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolAnalytics* getAnalyticsPlugin(){return _pAnalytics;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get User plugin
|
||||||
|
@return if User plugin exist ,return value is User plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolUser* getUserPlugin(){return _pUser;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get YAP plugin
|
||||||
|
@return if YAP plugin exist ,return value is YAP plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
std::map<std::string , ProtocolYAP*>* getYAPPlugin(){return &_pluginsYAPMap;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Share plugin
|
||||||
|
@return if Share plugin exist ,return value is Share plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolShare* getSharePlugin(){return _pShare;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Social plugin
|
||||||
|
@return if Social plugin exist ,return value is Social plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolSocial* getSocialPlugin(){return _pSocial;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Ads plugin
|
||||||
|
@return if Ads plugin exist ,return value is Ads plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolAds* getAdsPlugin(){return _pAds;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Push plugin
|
||||||
|
@return if Push plugin exist ,return value is Push plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolPush* getPushPlugin(){return _pPush;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Crash plugin
|
||||||
|
@return if Crash plugin exist ,return value is Crash plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolCrash* getCrashPlugin(){return _pCrash;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get Custom plugin
|
||||||
|
@return if Crash plugin exist ,return value is Custom plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolCustom* getCustomPlugin(){return _pCustom;};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get REC plugin
|
||||||
|
@return if REC plugin exist ,return value is REC plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolREC* getRECPlugin(){return _pREC;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get AdTracking plugin
|
||||||
|
@return if AdTracking plugin exist ,return value is AdTracking plugin.
|
||||||
|
else return value is null pointer.
|
||||||
|
*/
|
||||||
|
ProtocolAdTracking* getAdTrackingPlugin(){return _pAdTracking;};
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get channel ID
|
||||||
|
@return return value is channel ID.
|
||||||
|
*/
|
||||||
|
std::string getChannelId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get custom param
|
||||||
|
@return return value is custom param for channel.
|
||||||
|
*/
|
||||||
|
std::string getCustomParam();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get framework version
|
||||||
|
@return return value is the version of AnySDKFramework.
|
||||||
|
*/
|
||||||
|
std::string getFrameworkVersion();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@Title: setIsAnaylticsEnabled
|
||||||
|
@Description: choose to open or close
|
||||||
|
@param @param enabled true or false
|
||||||
|
@return void
|
||||||
|
*/
|
||||||
|
void setIsAnaylticsEnabled(bool value){bIsAnaylticsEnabled = value;};
|
||||||
|
/**
|
||||||
|
@Title: isAnaylticsEnabled
|
||||||
|
@Description: the status of Anayltics
|
||||||
|
@param @return true or false
|
||||||
|
@return boolean
|
||||||
|
*/
|
||||||
|
bool isAnaylticsEnabled(){return bIsAnaylticsEnabled;};
|
||||||
|
|
||||||
|
|
||||||
|
void loadPlugin(const char* nodeName,int type);
|
||||||
|
protected:
|
||||||
|
void setDebugMode(bool flag);
|
||||||
|
std::string getSupportPlugin();
|
||||||
|
void release();
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
AgentManager(void);
|
||||||
|
|
||||||
|
// Analytics plugin
|
||||||
|
ProtocolAnalytics* _pAnalytics;
|
||||||
|
|
||||||
|
// user plugin
|
||||||
|
ProtocolUser* _pUser;
|
||||||
|
|
||||||
|
// YAP plugins
|
||||||
|
// ProtocolYAP* _pYAP;
|
||||||
|
std::map<std::string , ProtocolYAP*> _pluginsYAPMap;
|
||||||
|
|
||||||
|
// Share plugin
|
||||||
|
ProtocolShare* _pShare;
|
||||||
|
|
||||||
|
// Social plugin
|
||||||
|
ProtocolSocial* _pSocial;
|
||||||
|
|
||||||
|
// Ads plugin
|
||||||
|
ProtocolAds* _pAds;
|
||||||
|
|
||||||
|
// Push plugin
|
||||||
|
ProtocolPush* _pPush;
|
||||||
|
|
||||||
|
// Crash plugin
|
||||||
|
ProtocolCrash* _pCrash;
|
||||||
|
|
||||||
|
// Custom plugin
|
||||||
|
ProtocolCustom* _pCustom;
|
||||||
|
|
||||||
|
// REC plugin
|
||||||
|
ProtocolREC* _pREC;
|
||||||
|
|
||||||
|
// AdTracking plugin
|
||||||
|
ProtocolAdTracking* _pAdTracking;
|
||||||
|
|
||||||
|
bool bIsAnaylticsEnabled;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} //namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_AGENTMANAGER_H__ */
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
//
|
||||||
|
// AnalyticsWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-10-9.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ACCOUNT_TYPE_ANONYMOUS,/**< enum value is anonymous typek. */
|
||||||
|
ACCOUNT_TYPE_REGISTED,/**< enum value is registed type. */
|
||||||
|
ACCOUNT_TYPE_SINA_WEIBO,/**< enum value is sineweibo type. */
|
||||||
|
ACCOUNT_TYPE_TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
||||||
|
ACCOUNT_TYPE_QQ,/**< enum value is qq type */
|
||||||
|
ACCOUNT_TYPE_ND91,/**< enum value is nd91 type. */
|
||||||
|
} ANALYTICS_ACCOUNT_TYPE;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ACCOUNT_OPERATE_LOGIN,/**< enum value is the login operate. */
|
||||||
|
ACCOUNT_OPERATE_LOGOUT,/**< enum value is the logout operate. */
|
||||||
|
ACCOUNT_OPERATE_REGISTER,/**< enum value is the register operate. */
|
||||||
|
}ANALYTICS_ACCOUNT_OPERATE;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ACCOUNT_GENDER_MALE,/**< enum value is male. */
|
||||||
|
ACCOUNT_GENDER_FEMALE,/**< enum value is female. */
|
||||||
|
ACCOUNT_GENDER_UNKNOWN,/**< enum value is unknow. */
|
||||||
|
|
||||||
|
} ANALYTICS_ACCOUNT_GENDER;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
TASK_TYPE_GUIDE_LINE,/**< enum value is the guideline type.. */
|
||||||
|
TASK_TYPE_MAIN_LINE,/**< enum value is the mainline type.. */
|
||||||
|
TASK_TYPE_BRANCH_LINE,/**<enum value is the branchline type.. */
|
||||||
|
TASK_TYPE_DAILY,/**< enum value is the daily type.. */
|
||||||
|
TASK_TYPE_ACTIVITY,/**< enum value is the activity type. */
|
||||||
|
TASK_TYPE_OTHER,/**< enum value is other type. */
|
||||||
|
} ANALYTICS_TASK_TYPE;
|
||||||
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
#ifndef __CRT_SDK_DELEGATE_H
|
||||||
|
#define __CRT_SDK_DELEGATE_H
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol CocosRuntimeSDKDelegate <NSObject>
|
||||||
|
|
||||||
|
- (NSMutableArray*)getSupportForPlugins;
|
||||||
|
- (NSMutableDictionary*)getPluginParams;
|
||||||
|
- (NSString*)getDevelopInfo;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif /* __CRT_SDK_DELEGATE_H */
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// CustomWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
CUSTOMRESULT_CUSTOMEXTENSION = 80000 /**< enum value is extension code . */
|
||||||
|
} CUSTOM_RET_CODE;
|
||||||
|
|
||||||
|
@interface CustomWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback interface of Custom system
|
||||||
|
*
|
||||||
|
* @param pPlugin the Custom plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void) onCustomResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol InterfaceAdTracking<NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: onRegister
|
||||||
|
* @Description: Call this method if you want to track register events as happening during a section.
|
||||||
|
* @param userInfo user identifier
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
- (void) onRegister: (NSString*) userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: onLogin
|
||||||
|
* @Description:Call this method if you want to track login events as happening during a section.
|
||||||
|
* @param userInfo The details of this parameters are already covered by document.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
- (void) onLogin: (NSMutableDictionary*) userInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: onYap
|
||||||
|
* @Description: Call this method if you want to track yap events as happening during a section.
|
||||||
|
* @param productInfo The details of this parameters are already covered by document.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
- (void) onYap: (NSMutableDictionary*) productInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: trackEvent
|
||||||
|
* @Description: Call this method if you want to track custom events as happening during a section.
|
||||||
|
* @param eventId The custom event name.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
- (void) trackEvent: (NSString*) eventId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: trackEvent
|
||||||
|
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
||||||
|
* @param eventId The custom event name.
|
||||||
|
* @param paramMap The details of this parameters are already covered by document.
|
||||||
|
*/
|
||||||
|
- (void) trackEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol InterfaceAds<NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* show advertising
|
||||||
|
*
|
||||||
|
* @param info the parameters of the advertising
|
||||||
|
key:Param1 value:the type of advertising
|
||||||
|
key:Param2 value:the order of advertising
|
||||||
|
*/
|
||||||
|
- (void) showAds: (NSMutableDictionary*) info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hide advertising
|
||||||
|
*
|
||||||
|
* @param info the parameters of the advertising
|
||||||
|
key:Param1 value:the type of advertising
|
||||||
|
key:Param2 value:the order of advertising
|
||||||
|
*/
|
||||||
|
- (void) hideAds: (NSMutableDictionary*) info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* preload advertising
|
||||||
|
*
|
||||||
|
* @param info the parameters of the advertising
|
||||||
|
key:Param1 value:the type of advertising
|
||||||
|
key:Param2 value:the order of advertising
|
||||||
|
*/
|
||||||
|
- (void) preloadAds: (NSMutableDictionary*) info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* query the points
|
||||||
|
*
|
||||||
|
* @return points
|
||||||
|
*/
|
||||||
|
- (float) queryPoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* spend user`s points
|
||||||
|
*
|
||||||
|
* @param points the points of spending
|
||||||
|
*/
|
||||||
|
- (void) spendPoints: (int) points;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description
|
||||||
|
*
|
||||||
|
* @param adType the type of advertising
|
||||||
|
*
|
||||||
|
* @return if the type is supported ,return true
|
||||||
|
or if the type is supported ,return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isAdTypeSupported: (int)adType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,132 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol InterfaceAnalytics<NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* start session analytics
|
||||||
|
*/
|
||||||
|
- (void) startSession;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* stop session analytics
|
||||||
|
*/
|
||||||
|
- (void) stopSession;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the timeout for expiring a session.
|
||||||
|
*
|
||||||
|
* @param millis In milliseconds as the unit of time.
|
||||||
|
* @note It must be invoked before calling startSession.
|
||||||
|
*/
|
||||||
|
- (void) setSessionContinueMillis: (long) millis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to catch uncaught exceptions to server.
|
||||||
|
*
|
||||||
|
* @warning This interface only worked on android.
|
||||||
|
*/
|
||||||
|
- (void) setCaptureUncaughtException: (BOOL) isEnabled;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log an error
|
||||||
|
*
|
||||||
|
* @param errorId The identity of event
|
||||||
|
* @param message message for the error
|
||||||
|
*/
|
||||||
|
- (void) logError: (NSString*) errorId withMsg:(NSString*) message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log an event
|
||||||
|
*
|
||||||
|
* @param eventId The identity of event
|
||||||
|
*/
|
||||||
|
- (void) logEvent: (NSString*) eventId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log an event
|
||||||
|
*
|
||||||
|
* @param eventId The identity of event
|
||||||
|
* @param paramMap Extern parameters of the event
|
||||||
|
*/
|
||||||
|
- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Track an event begin
|
||||||
|
*
|
||||||
|
* @param eventId The identity of event
|
||||||
|
*/
|
||||||
|
- (void) logTimedEventBegin: (NSString*) eventId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Track an event end.
|
||||||
|
*
|
||||||
|
* @param eventId The identity of event
|
||||||
|
*/
|
||||||
|
- (void) logTimedEventEnd: (NSString*) eventId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfaceCrash <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set user identifier
|
||||||
|
*
|
||||||
|
* @param userInfo
|
||||||
|
*/
|
||||||
|
- (void) setUserIdentifier: (NSString*)identifier ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The uploader captured in exception information
|
||||||
|
*
|
||||||
|
* @param message Set the custom information
|
||||||
|
* @param exception The exception
|
||||||
|
*/
|
||||||
|
- (void) reportException: (NSString*)message exception:(NSString*)exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* customize logging
|
||||||
|
*
|
||||||
|
* @param string Custom log
|
||||||
|
*/
|
||||||
|
- (void) leaveBreadcrumb: (NSString*)breadcrumb;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfaceCustom <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfacePush <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* start push service
|
||||||
|
*/
|
||||||
|
- (void) startPush;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* close push service
|
||||||
|
*/
|
||||||
|
- (void) closePush;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set alias
|
||||||
|
*
|
||||||
|
* @param alias the value of alias
|
||||||
|
*/
|
||||||
|
- (void) setAlias: (NSString*)alias;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* delete alias
|
||||||
|
*
|
||||||
|
* @param alias the value of alias
|
||||||
|
*/
|
||||||
|
- (void) delAlias: (NSString*)alias;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set tags
|
||||||
|
*
|
||||||
|
* @param tags the content of tags
|
||||||
|
*/
|
||||||
|
- (void) setTags: (NSMutableArray*)tags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* delete tags
|
||||||
|
*
|
||||||
|
* @param tags the content of tags
|
||||||
|
*/
|
||||||
|
- (void) delTags: (NSMutableArray*)tags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfaceREC <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: startRecording
|
||||||
|
* @Description: Start to record video
|
||||||
|
* @param @return None
|
||||||
|
* @return void
|
||||||
|
* @throws
|
||||||
|
*/
|
||||||
|
- (void) startRecording;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: stopRecording
|
||||||
|
* @Description: Stop to record video
|
||||||
|
* @param @return None
|
||||||
|
* @return void
|
||||||
|
* @throws
|
||||||
|
*/
|
||||||
|
- (void) stopRecording;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: share
|
||||||
|
* @Description: share video
|
||||||
|
* @param @param info the info of video
|
||||||
|
* @return void
|
||||||
|
* @throws
|
||||||
|
*/
|
||||||
|
- (void) share:(NSMutableDictionary *) info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfaceShare <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* share
|
||||||
|
*
|
||||||
|
* @param shareInfo the content of share
|
||||||
|
* @note the description is subject to the wiki(http://docs.anysdk.com/YAPSystem#.E6.94.AF.E4.BB.98)
|
||||||
|
*/
|
||||||
|
- (void) share: (NSMutableDictionary*) shareInfo;
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfaceSocial <NSObject>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* login in socail system
|
||||||
|
*/
|
||||||
|
- (void) signIn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* logout in socail system
|
||||||
|
*/
|
||||||
|
- (void) signOut;
|
||||||
|
/**
|
||||||
|
* submit the socre for leaderboard
|
||||||
|
*
|
||||||
|
* @param leaderboardID the identifier of leaderboard
|
||||||
|
* @param score the score
|
||||||
|
*/
|
||||||
|
- (void) submitScore: (NSString*) leaderboardID withScore: (long) score;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show the leaderboard
|
||||||
|
*
|
||||||
|
* @param leaderboardID the identifier of leaderboard
|
||||||
|
*/
|
||||||
|
- (void) showLeaderboard: (NSString*) leaderboardID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* unlock achievements of game
|
||||||
|
*
|
||||||
|
* @param achInfo the content of achievement
|
||||||
|
*/
|
||||||
|
- (void) unlockAchievement: (NSMutableDictionary*) achInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show achievements of game
|
||||||
|
*/
|
||||||
|
- (void) showAchievements;
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
@protocol InterfaceUser <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* user login
|
||||||
|
*/
|
||||||
|
- (void) login;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the status of login
|
||||||
|
*
|
||||||
|
* @return status of login
|
||||||
|
*/
|
||||||
|
- (BOOL) isLogined;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get user identifier
|
||||||
|
*
|
||||||
|
* @return user identifier
|
||||||
|
*/
|
||||||
|
- (NSString*) getUserID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the identifier of plugin
|
||||||
|
*
|
||||||
|
* @return the identifier of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@protocol InterfaceYAP <NSObject>
|
||||||
|
|
||||||
|
@required
|
||||||
|
/**
|
||||||
|
* yap for product
|
||||||
|
*
|
||||||
|
* @param profuctInfo the information of the product
|
||||||
|
key:Product_Id value: the identifier of product
|
||||||
|
key:Product_Name value: the name of product
|
||||||
|
key:Product_Price value: the price of product, denominated as the yuan.
|
||||||
|
key:Product_Count value: the count of product
|
||||||
|
key:Role_Id value:the identifier of role
|
||||||
|
key:Role_Name value: the name of role
|
||||||
|
key:Role_Grade value: the grade of role
|
||||||
|
key:Role_Balance value: the virtual currency amount of role
|
||||||
|
key:Server_Id value: the identifier of yaping server
|
||||||
|
key:EXT value: Extended Parameters
|
||||||
|
* @note the rule of production maybe changes,please the description is subject to the wiki(http://docs.anysdk.com/YAPSystem#.E6.94.AF.E4.BB.98)
|
||||||
|
*/
|
||||||
|
- (void) yapForProduct: (NSMutableDictionary*) productInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the order identifier
|
||||||
|
*
|
||||||
|
* @return the order identifier
|
||||||
|
*/
|
||||||
|
- (NSString*) getOrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of SDK
|
||||||
|
*
|
||||||
|
* @return the version of SDK
|
||||||
|
*/
|
||||||
|
- (NSString*) getSDKVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the version of plugin
|
||||||
|
*
|
||||||
|
* @return the version of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the identifier of plugin
|
||||||
|
*
|
||||||
|
* @return the identifier of plugin
|
||||||
|
*/
|
||||||
|
- (NSString*) getPluginId;
|
||||||
|
|
||||||
|
@optional
|
||||||
|
/**
|
||||||
|
* init SDK
|
||||||
|
*
|
||||||
|
* @param cpInfo the parameters of SDK
|
||||||
|
*/
|
||||||
|
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set debug mode true or false
|
||||||
|
*
|
||||||
|
* @param debug the status of debug
|
||||||
|
*/
|
||||||
|
- (void) setDebugMode: (BOOL) debug;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether function is supported
|
||||||
|
*
|
||||||
|
* @param functionName the name of function
|
||||||
|
*
|
||||||
|
* @return return If the function is supported, return true
|
||||||
|
or if the function is not supported, return false
|
||||||
|
*/
|
||||||
|
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
/** @file JSBRelation.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_JSBRELATION_H__
|
||||||
|
#define __CCX_JSBRELATION_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class JSBRelation
|
||||||
|
*/
|
||||||
|
class JSBRelation
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static string getMethodsOfPlugin(PluginProtocol* plugin);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
}} //namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_JSBRELATION_H__ */
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
// JsonParser.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-9-17.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
@interface JsonParser : NSObject
|
||||||
|
|
||||||
|
+(NSString*)parseJsonForNSKey:(NSString*)data key:(NSString*)key __attribute__((deprecated));
|
||||||
|
|
||||||
|
+(NSString*)parseJsonForNSKey:(NSString*)data key:(NSString*)key key2:(NSString*)key2 __attribute__((deprecated));
|
||||||
|
|
||||||
|
+(NSString*)parseJsonForNSKey:(NSString*)data key:(NSString*)key key2:(NSString*)key2 key3:(NSString*)key3 __attribute__((deprecated));
|
||||||
|
|
||||||
|
|
||||||
|
+(const char*)parseJsonForKey:(const char*)data key:(const char*)key __attribute__((deprecated));
|
||||||
|
|
||||||
|
+(const char*)parseJsonForKey:(const char*)data key:(const char*)key key2:(const char*)key2 __attribute__((deprecated));
|
||||||
|
|
||||||
|
+(const char*)parseJsonForKey:(const char*)data key:(const char*)key key2:(const char*)key2 key3:(const char*)key3 __attribute__((deprecated));
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
/****************************************************************************
|
||||||
|
Copyright (c) 2012+2013 cocos2d+x.org
|
||||||
|
|
||||||
|
http://www.cocos2d+x.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
****************************************************************************/
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
@protocol PluginApplicationDelegate <NSObject>
|
||||||
|
|
||||||
|
@optional
|
||||||
|
//about user system
|
||||||
|
|
||||||
|
- (void)applicationDidEnterBackground:(UIApplication *)application ;
|
||||||
|
- (void)applicationWillEnterForeground:(UIApplication *)application ;
|
||||||
|
|
||||||
|
|
||||||
|
//about yap system
|
||||||
|
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation ;
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
|
||||||
|
|
||||||
|
|
||||||
|
//about push system
|
||||||
|
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken ;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error ;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler ;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
/** @file PluginFactory.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PLUGIN_FACTORY_H__
|
||||||
|
#define __CCX_PLUGIN_FACTORY_H__
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
class PluginProtocol;
|
||||||
|
class PluginManager;
|
||||||
|
/**
|
||||||
|
* @class PluginFactory
|
||||||
|
*/
|
||||||
|
class PluginFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~PluginFactory();
|
||||||
|
/**
|
||||||
|
@brief Get singleton of PluginFactory
|
||||||
|
*/
|
||||||
|
static PluginFactory* getInstance();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Destory the instance of PluginFactory
|
||||||
|
*/
|
||||||
|
static void purgeFactory();
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class PluginManager;
|
||||||
|
PluginFactory(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief create the plugin by name and type
|
||||||
|
@param the name of plugin
|
||||||
|
@param the type of plugin
|
||||||
|
*/
|
||||||
|
PluginProtocol* createPlugin(const char* name, int pluginType);
|
||||||
|
};
|
||||||
|
|
||||||
|
}} //namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PLUGIN_FACTORY_H__ */
|
||||||
|
|
@ -0,0 +1,130 @@
|
||||||
|
//
|
||||||
|
// PluginHelper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-8-29.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface PluginHelper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the parameters of SDK
|
||||||
|
*
|
||||||
|
* @return the parameters of SDK
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getParamsInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: getDebugModeStatus
|
||||||
|
* @Description: get the status of DebugMode
|
||||||
|
* @param @return status
|
||||||
|
* @return BOOL yes or no
|
||||||
|
*/
|
||||||
|
+ (BOOL) getDebugModeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: getLogLevel
|
||||||
|
* @Description: get the level of log
|
||||||
|
* @param @return level
|
||||||
|
* @return "verbose" "debug" "info" "warning" "error"
|
||||||
|
*/
|
||||||
|
+ (NSString*) getLogLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the status of network
|
||||||
|
*
|
||||||
|
* @return if the network is reachable ,return true
|
||||||
|
or if the network is reachable,return false
|
||||||
|
*/
|
||||||
|
+ (BOOL) networkReachable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get current RootViewController
|
||||||
|
*
|
||||||
|
* @return RootViewController
|
||||||
|
*/
|
||||||
|
+ (UIViewController *)getCurrentRootViewController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* network transmission in plugin
|
||||||
|
*
|
||||||
|
* @param data content transmitted over the network
|
||||||
|
* @param target callback object
|
||||||
|
* @param sel callback function
|
||||||
|
* @note the content must contain the value that key is "server_url"
|
||||||
|
* @note http use post
|
||||||
|
*/
|
||||||
|
+ (void) pluginHttp:(NSMutableDictionary*)data target:(id)target sel:(SEL)sel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log output ,the lever is verbose
|
||||||
|
*
|
||||||
|
* @param message the message about this log
|
||||||
|
*/
|
||||||
|
+ (void) logVerbose:(NSString*)format,...;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log output ,the lever is error
|
||||||
|
*
|
||||||
|
* @param message the message about this log
|
||||||
|
*/
|
||||||
|
+ (void) logError:(NSString*)format,...;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log output ,the lever is debug
|
||||||
|
*
|
||||||
|
* @param message the message about this log
|
||||||
|
*/
|
||||||
|
+ (void) logDebug:(NSString*)format,...;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* log output ,the lever is info
|
||||||
|
*
|
||||||
|
* @param message the message about this log
|
||||||
|
*/
|
||||||
|
+ (void) logInfo:(NSString*)format,...;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the game identifier
|
||||||
|
*
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
|
+ (NSString*) getGameId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the application name
|
||||||
|
*
|
||||||
|
* @return name
|
||||||
|
*/
|
||||||
|
+ (NSString*) getApplicationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the application orientation
|
||||||
|
*
|
||||||
|
* @return multiple orientation
|
||||||
|
*/
|
||||||
|
+ (NSArray*) getApplicationOrientation;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the application version
|
||||||
|
*
|
||||||
|
* @return version
|
||||||
|
*/
|
||||||
|
+ (NSString*) getApplicationVersion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parsing XML file
|
||||||
|
* @param the name of XML file
|
||||||
|
* @return NSMutableDictionary the content of XML file
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getXMLInfoByFileName:(NSString*)fileName;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
/** @file PluginFactory.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PLUGINMANAGER_H__
|
||||||
|
#define __CCX_PLUGINMANAGER_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include "PluginFactory.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class PluginManager
|
||||||
|
*/
|
||||||
|
class PluginManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~PluginManager();
|
||||||
|
/**
|
||||||
|
@brief Get singleton of PluginManager
|
||||||
|
*/
|
||||||
|
static PluginManager* getInstance();
|
||||||
|
/**
|
||||||
|
@brief Destory the instance of PluginManager
|
||||||
|
*/
|
||||||
|
static void end();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief load the plugin by name and type
|
||||||
|
@param the name of plugin
|
||||||
|
@param the type of plugin
|
||||||
|
*/
|
||||||
|
PluginProtocol* loadPlugin(const char* name, int pluginType);
|
||||||
|
/**
|
||||||
|
@brief unload the plugin by name and type
|
||||||
|
@param the name of plugin
|
||||||
|
@param the type of plugin
|
||||||
|
*/
|
||||||
|
void unloadPlugin(const char* name, int pluginType = 0);
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
PluginManager(void);
|
||||||
|
std::map<std::string, PluginProtocol*> _pluginsMap;
|
||||||
|
// bool _isDebug;
|
||||||
|
};
|
||||||
|
|
||||||
|
}} //namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PLUGINMANAGER_H__ */
|
||||||
|
|
@ -0,0 +1,126 @@
|
||||||
|
/** @file PluginParam.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PLUGIN_PARAM_H__
|
||||||
|
#define __CCX_PLUGIN_PARAM_H__
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
/// \typedef std::map<std::string, std::string> StringMap
|
||||||
|
/// typedef YString.
|
||||||
|
typedef std::map<std::string, std::string> StringMap;
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
class PluginProtocol;
|
||||||
|
/**
|
||||||
|
* @class PluginParam
|
||||||
|
*/
|
||||||
|
class PluginParam
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
@brief the default constructor of PluginParam
|
||||||
|
*/
|
||||||
|
PluginParam();
|
||||||
|
|
||||||
|
virtual ~PluginParam();
|
||||||
|
/**
|
||||||
|
@brief the constructor of PluginParam
|
||||||
|
@param the value is Integer
|
||||||
|
*/
|
||||||
|
PluginParam(int nValue);
|
||||||
|
/**
|
||||||
|
@brief the constructor of PluginParam
|
||||||
|
@param the value is float
|
||||||
|
*/
|
||||||
|
PluginParam(float fValue);
|
||||||
|
/**
|
||||||
|
@brief the constructor of PluginParam
|
||||||
|
@param the value is boolean
|
||||||
|
*/
|
||||||
|
PluginParam(bool bValue);
|
||||||
|
/**
|
||||||
|
@brief the default constructor of PluginParam
|
||||||
|
@param the value is char
|
||||||
|
*/
|
||||||
|
PluginParam(const char* strValue);
|
||||||
|
/**
|
||||||
|
@brief the default constructor of PluginParam
|
||||||
|
@param the value is StringMap
|
||||||
|
*/
|
||||||
|
PluginParam(StringMap strMapValue);
|
||||||
|
|
||||||
|
typedef enum{
|
||||||
|
kParamTypeNull = 0,
|
||||||
|
kParamTypeInt,
|
||||||
|
kParamTypeFloat,
|
||||||
|
kParamTypeBool,
|
||||||
|
kParamTypeString,
|
||||||
|
kParamTypeStringMap,
|
||||||
|
kParamTypeMap,
|
||||||
|
} ParamType;
|
||||||
|
/**
|
||||||
|
@brief get the ParamType of value
|
||||||
|
*/
|
||||||
|
inline ParamType getCurrentType() {
|
||||||
|
return _type;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief get the int value
|
||||||
|
*/
|
||||||
|
inline int getIntValue() {
|
||||||
|
return _intValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief get the float value
|
||||||
|
*/
|
||||||
|
inline float getFloatValue() {
|
||||||
|
return _floatValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief get the boolean value
|
||||||
|
*/
|
||||||
|
inline bool getBoolValue() {
|
||||||
|
return _boolValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief get the char value
|
||||||
|
*/
|
||||||
|
inline const char* getStringValue() {
|
||||||
|
return _strValue.c_str();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief get the map of value
|
||||||
|
*/
|
||||||
|
inline std::map<std::string, PluginParam*> getMapValue() {
|
||||||
|
return _mapValue;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief get the StringMap value
|
||||||
|
*/
|
||||||
|
inline StringMap getStrMapValue() {
|
||||||
|
return _strMapValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class PluginProtocol;
|
||||||
|
/**
|
||||||
|
@brief the constructor of PluginParam
|
||||||
|
@param the map of value
|
||||||
|
*/
|
||||||
|
PluginParam(std::map<std::string, PluginParam*> mapValue);
|
||||||
|
|
||||||
|
private:
|
||||||
|
ParamType _type;
|
||||||
|
|
||||||
|
int _intValue;
|
||||||
|
float _floatValue;
|
||||||
|
bool _boolValue;
|
||||||
|
std::string _strValue;
|
||||||
|
std::map<std::string, PluginParam*> _mapValue;
|
||||||
|
StringMap _strMapValue;
|
||||||
|
};
|
||||||
|
|
||||||
|
}} //namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PLUGIN_PARAM_H__ */
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
/** @file PluginProtocol.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_IPLUGIN_H__
|
||||||
|
#define __CCX_IPLUGIN_H__
|
||||||
|
|
||||||
|
#include "PluginParam.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||||
|
#define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
||||||
|
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
||||||
|
#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated)
|
||||||
|
#else
|
||||||
|
#define CC_DEPRECATED_ATTRIBUTE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @class PluginProtocol
|
||||||
|
* @brief The super class for all plugins.
|
||||||
|
*/
|
||||||
|
class PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~PluginProtocol() {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief set plugin name
|
||||||
|
*@param the name of plugin
|
||||||
|
*/
|
||||||
|
virtual void setPluginName(const char* name) = 0 ;
|
||||||
|
/**
|
||||||
|
*@brief get plugin name
|
||||||
|
*@return the name of plugin
|
||||||
|
*/
|
||||||
|
virtual const char* getPluginName() = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief get the version of plugin
|
||||||
|
*@return the version of plugin
|
||||||
|
*/
|
||||||
|
virtual std::string getPluginVersion();
|
||||||
|
/**
|
||||||
|
*@brief get the version of sdk
|
||||||
|
*@return the version of sdk
|
||||||
|
*/
|
||||||
|
virtual std::string getSDKVersion();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief switch debug plug-in on/off
|
||||||
|
*@param the value of on/off
|
||||||
|
*/
|
||||||
|
CC_DEPRECATED_ATTRIBUTE virtual void setDebugMode(bool bDebug);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param PluginParam* param
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void callFuncWithParam(const char* funcName, PluginParam* param, ...);
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param std::vector<PluginParam*> params
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void callFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param PluginParam* param
|
||||||
|
*@return string
|
||||||
|
*/
|
||||||
|
virtual std::string callStringFuncWithParam(const char* funcName, PluginParam* param, ...);
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param std::vector<PluginParam*> params
|
||||||
|
*@return string
|
||||||
|
*/
|
||||||
|
virtual std::string callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param PluginParam* param
|
||||||
|
*@return int
|
||||||
|
*/
|
||||||
|
virtual int callIntFuncWithParam(const char* funcName, PluginParam* param, ...);
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param std::vector<PluginParam*> params
|
||||||
|
*@return int
|
||||||
|
*/
|
||||||
|
virtual int callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param PluginParam* param
|
||||||
|
*@return bool
|
||||||
|
*/
|
||||||
|
virtual bool callBoolFuncWithParam(const char* funcName, PluginParam* param, ...);
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param std::vector<PluginParam*> params
|
||||||
|
*@return bool
|
||||||
|
*/
|
||||||
|
virtual bool callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param PluginParam* param
|
||||||
|
*@return float
|
||||||
|
*/
|
||||||
|
virtual float callFloatFuncWithParam(const char* funcName, PluginParam* param, ...);
|
||||||
|
/**
|
||||||
|
*@brief methods for reflections
|
||||||
|
*@param function name
|
||||||
|
*@param std::vector<PluginParam*> params
|
||||||
|
*@return float
|
||||||
|
*/
|
||||||
|
virtual float callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Check function the plugin support or not
|
||||||
|
@param the name of plugin
|
||||||
|
@return if the function support ,return true
|
||||||
|
else retur false
|
||||||
|
*/
|
||||||
|
virtual bool isFunctionSupported(std::string functionName);
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} //namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_IPLUGIN_H__ */
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
//
|
||||||
|
// PluginWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "PluginApplicationDelegate.h"
|
||||||
|
@interface PluginWrapper : NSObject
|
||||||
|
|
||||||
|
@property (nonatomic, strong) NSMutableArray * arrayDelegate;
|
||||||
|
|
||||||
|
+ (PluginWrapper*) getInstance;
|
||||||
|
|
||||||
|
- (void) setDelegate:(id<PluginApplicationDelegate>)delegate;
|
||||||
|
|
||||||
|
//about user system
|
||||||
|
|
||||||
|
- (void)applicationDidEnterBackground:(UIApplication *)application ;
|
||||||
|
- (void)applicationWillEnterForeground:(UIApplication *)application ;
|
||||||
|
|
||||||
|
//about yap system
|
||||||
|
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation ;
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
|
||||||
|
|
||||||
|
|
||||||
|
//about push system
|
||||||
|
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken ;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler ;
|
||||||
|
|
||||||
|
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
/** @file ProtocolAdTracking.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_ADTRACKING_H__
|
||||||
|
#define __CCX_PROTOCOL_ADTRACKING_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/**
|
||||||
|
*@class ProtocolAdTracking
|
||||||
|
*@brief the interface of AdTracking
|
||||||
|
*/
|
||||||
|
class ProtocolAdTracking : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: onRegister
|
||||||
|
* @Description: Call this method if you want to track register events as happening during a section.
|
||||||
|
* @param userId user identifier
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
virtual void onRegister(const char* userId) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: onLogin
|
||||||
|
* @Description:Call this method if you want to track login events as happening during a section.
|
||||||
|
* @param userInfo The details of this parameters are already covered by document.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
virtual void onLogin(std::map<std::string, std::string> userInfo) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: onYap
|
||||||
|
* @Description: Call this method if you want to track yap events as happening during a section.
|
||||||
|
* @param productInfo The details of this parameters are already covered by document.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
virtual void onYap(std::map<std::string, std::string> productInfo) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: trackEvent
|
||||||
|
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
||||||
|
* @param eventId The custom event name.
|
||||||
|
* @param paramMap The details of this parameters are already covered by document.
|
||||||
|
*/
|
||||||
|
virtual void trackEvent(const char* eventId, std::map<std::string, std::string>* paramMap = NULL) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* ----- #ifndef __CCX_PROTOCOL_ADTRACKING_H__ ----- */
|
||||||
|
|
@ -0,0 +1,133 @@
|
||||||
|
/** @file ProtocolAds.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_ADS_H__
|
||||||
|
#define __CCX_PROTOCOL_ADS_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/// \typedef std::map<std::string, std::string> TAdsDeveloperInfo
|
||||||
|
/// typedef TAdsDeveloperInfo.
|
||||||
|
typedef std::map<std::string, std::string> TAdsDeveloperInfo;
|
||||||
|
/// \typedef std::map<std::string, std::string> TAdsInfo
|
||||||
|
/// typedef TAdsInfo.
|
||||||
|
typedef std::map<std::string, std::string> TAdsInfo;
|
||||||
|
/** @brief AdsResultCode enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kAdsReceived = 0, /**< enum the callback: the ad is received is at center. */
|
||||||
|
|
||||||
|
kAdsShown, /**< enum the callback: the advertisement dismissed. */
|
||||||
|
kAdsDismissed, /**< enum the callback: the advertisement dismissed. */
|
||||||
|
|
||||||
|
kPointsSpendSucceed, /**< enum the callback: the points spend succeed. */
|
||||||
|
kPointsSpendFailed, /**< enum the callback: the points spend failed. */
|
||||||
|
|
||||||
|
kNetworkError, /**< enum the callback of Network error at center. */
|
||||||
|
kUnknownError, /**< enum the callback of Unknown error. */
|
||||||
|
kOfferWallOnPointsChanged, /**< enum the callback of Changing the point of offerwall. */
|
||||||
|
kRewardedVideoWithReward,/**< enum the callback of receiving the reward of rewardedvideo. */
|
||||||
|
kInAppPurchaseFinished,/**< enum the callback of finishing YAP ad. */
|
||||||
|
kAdsClicked,/**< enum the callback of the advertisement clicked. */
|
||||||
|
kAdsExtension = 40000 /**< enum value is extension code . */
|
||||||
|
} AdsResultCode;
|
||||||
|
/** @brief AdsPos enum, with inline docs */
|
||||||
|
typedef enum {
|
||||||
|
kPosCenter = 0,/**< enum the toolbar is at center. */
|
||||||
|
kPosTop,/**< enum the toolbar is at top. */
|
||||||
|
kPosTopLeft,/**< enum the toolbar is at topleft. */
|
||||||
|
kPosTopRight,/**< enum the toolbar is at topright. */
|
||||||
|
kPosBottom,/**< enum the toolbar is at bottom. */
|
||||||
|
kPosBottomLeft,/**< enum the toolbar is at bottomleft. */
|
||||||
|
kPosBottomRight,/**< enum the toolbar is at bottomright. */
|
||||||
|
} AdsPos;
|
||||||
|
/** @brief AdsType enum, with inline docs */
|
||||||
|
typedef enum {
|
||||||
|
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
||||||
|
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
||||||
|
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
||||||
|
AD_TYPE_OFFERWALL,/**< enum value is offerwall ads . */
|
||||||
|
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
||||||
|
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
||||||
|
AD_TYPE_NATIVEADVANCED,/**< enum value is Native advanced ads . */
|
||||||
|
} AdsType;
|
||||||
|
|
||||||
|
class ProtocolAds;
|
||||||
|
class AdsListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief The advertisement request result
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onAdsResult(AdsResultCode code, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ProtocolAds : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief show adview
|
||||||
|
@param the type of ads
|
||||||
|
@param the idx of ads
|
||||||
|
*/
|
||||||
|
virtual void showAds(AdsType adsType, int idx = 1) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Hide the adview
|
||||||
|
@param the type of ads
|
||||||
|
@param the idx of ads
|
||||||
|
*/
|
||||||
|
virtual void hideAds(AdsType adsType, int idx = 1) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief preload the adview
|
||||||
|
@param the type of ads
|
||||||
|
@param the idx of ads
|
||||||
|
*/
|
||||||
|
virtual void preloadAds(AdsType adsType, int idx = 1)= 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief Query the points of player
|
||||||
|
*@return the point
|
||||||
|
*/
|
||||||
|
virtual float queryPoints() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief Spend the points.
|
||||||
|
Use this method to notify server spend points.
|
||||||
|
*@param points Need spend number of points
|
||||||
|
*/
|
||||||
|
virtual void spendPoints(int points) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief set the Ads listener
|
||||||
|
@param pListener The callback object for Ads result
|
||||||
|
*/
|
||||||
|
virtual void setAdsListener(AdsListener* listener) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief get pListener The callback object for Ads result
|
||||||
|
@return the listener
|
||||||
|
*/
|
||||||
|
virtual AdsListener* getAdsListener() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Is it supportive of this type of ads
|
||||||
|
@param the type of ads
|
||||||
|
@return if it is supportive ,return true
|
||||||
|
else retur false
|
||||||
|
*/
|
||||||
|
virtual bool isAdTypeSupported(AdsType adType) = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PROTOCOL_ADS_H__ */
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
/** @file ProtocolAnalytics.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_ANALYTICS_H__
|
||||||
|
#define __CCX_PROTOCOL_ANALYTICS_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/// \typedef std::map<std::string, std::string> LogEventParamPair
|
||||||
|
/// typedef LogEventParamPair.
|
||||||
|
typedef std::pair< std::string, std::string > LogEventParamPair;
|
||||||
|
/// \typedef std::map<std::string, std::string> LogEventParamMap
|
||||||
|
/// typedef LogEventParamMap.
|
||||||
|
typedef std::map< std::string, std::string > LogEventParamMap;
|
||||||
|
typedef enum {
|
||||||
|
ANONYMOUS,/**< enum value is anonymous typek. */
|
||||||
|
REGISTED,/**< enum value is registed type. */
|
||||||
|
SINA_WEIBO,/**< enum value is sineweibo type. */
|
||||||
|
TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
||||||
|
QQ,/**< enum value is qq type */
|
||||||
|
ND91,/**< enum value is nd91 type. */
|
||||||
|
} AccountType;
|
||||||
|
typedef enum {
|
||||||
|
LOGIN,/**< enum value is the login operate. */
|
||||||
|
LOGOUT,/**< enum value is the logout operate. */
|
||||||
|
REGISTER,/**< enum value is the register operate. */
|
||||||
|
} AccountOperate;
|
||||||
|
typedef enum {
|
||||||
|
MALE,/**< enum value is male. */
|
||||||
|
FEMALE,/**< enum value is female. */
|
||||||
|
UNKNOWN,/**< enum value is unknow. */
|
||||||
|
|
||||||
|
} AccountGender;
|
||||||
|
typedef enum {
|
||||||
|
GUIDE_LINE,/**< enum value is the guideline type.. */
|
||||||
|
MAIN_LINE,/**< enum value is the mainline type.. */
|
||||||
|
BRANCH_LINE,/**<enum value is the branchline type.. */
|
||||||
|
DAILY,/**< enum value is the daily type.. */
|
||||||
|
ACTIVITY,/**< enum value is the activity type. */
|
||||||
|
OTHER,/**< enum value is other type. */
|
||||||
|
} TaskType;
|
||||||
|
/**
|
||||||
|
*@class ProtocolAnalytics
|
||||||
|
*@brief the interface of Analytics
|
||||||
|
*/
|
||||||
|
class ProtocolAnalytics : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Start a new session.
|
||||||
|
*/
|
||||||
|
virtual void startSession() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Stop a session.
|
||||||
|
@warning This interface only worked on android
|
||||||
|
*/
|
||||||
|
virtual void stopSession() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Set the timeout for expiring a session.
|
||||||
|
@param millis In milliseconds as the unit of time.
|
||||||
|
@note It must be invoked before calling startSession.
|
||||||
|
*/
|
||||||
|
virtual void setSessionContinueMillis(long millis) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief log an error
|
||||||
|
@param errorId The identity of error
|
||||||
|
@param message Extern message for the error
|
||||||
|
*/
|
||||||
|
virtual void logError(const char* errorId, const char* message) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief log an event.
|
||||||
|
@param eventId The identity of event
|
||||||
|
@param paramMap Extern parameters of the event, use NULL if not needed.
|
||||||
|
*/
|
||||||
|
virtual void logEvent(const char* eventId, LogEventParamMap* paramMap = NULL) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Track an event begin.
|
||||||
|
@param eventId The identity of event
|
||||||
|
*/
|
||||||
|
virtual void logTimedEventBegin(const char* eventId) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Track an event end.
|
||||||
|
@param eventId The identity of event
|
||||||
|
*/
|
||||||
|
virtual void logTimedEventEnd(const char* eventId) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Whether to catch uncaught exceptions to server.
|
||||||
|
@warning This interface only worked on android.
|
||||||
|
*/
|
||||||
|
virtual void setCaptureUncaughtException(bool enabled) = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __CCX_PROTOCOL_ANALYTICS_H__ */
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
/** @file ProtocolCrash.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_CRASH_H__
|
||||||
|
#define __CCX_PROTOCOL_CRASH_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
class ProtocolCrash : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* set user identifier
|
||||||
|
*
|
||||||
|
* @param userInfo
|
||||||
|
*/
|
||||||
|
virtual void setUserIdentifier(const char* identifier) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The uploader captured in exception information
|
||||||
|
*
|
||||||
|
* @param message Set the custom information
|
||||||
|
* @param exception The exception
|
||||||
|
*/
|
||||||
|
virtual void reportException(const char* message, const char* exception) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* customize logging
|
||||||
|
*
|
||||||
|
* @param string Custom log
|
||||||
|
*/
|
||||||
|
virtual void leaveBreadcrumb(const char* breadcrumb) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PROTOCOL_CRASH_H__ */
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
/** @file ProtocolCustom.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_CUSTOM_H__
|
||||||
|
#define __CCX_PROTOCOL_CUSTOM_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kCustomExtension = 80000 /**< enum value is extension code . */
|
||||||
|
} CustomResultCode;
|
||||||
|
/**
|
||||||
|
*@class CustomResultListener
|
||||||
|
*@brief the interface of share callback
|
||||||
|
*/
|
||||||
|
class CustomResultListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of share callback
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onCustomResult(CustomResultCode ret, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
*@class ProtocolCustom
|
||||||
|
*@brief the interface of custom
|
||||||
|
*/
|
||||||
|
class ProtocolCustom : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
@breif set the result listener
|
||||||
|
@param pListener The callback object for custom result
|
||||||
|
@wraning Must invoke this interface before custom
|
||||||
|
*/
|
||||||
|
virtual void setResultListener(CustomResultListener* pListener) = 0;
|
||||||
|
|
||||||
|
virtual CustomResultListener* getCustomListener() = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* ----- #ifndef __CCX_PROTOCOL_Custom_H__ ----- */
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
/** @file PluginFactory.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_PUSH_H__
|
||||||
|
#define __CCX_PROTOCOL_PUSH_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <list>
|
||||||
|
#include <string>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/** @brief Plugin_type enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kPushReceiveMessage = 0,/**value is callback of Receiving Message . */
|
||||||
|
kPushExtensionCode = 60000 /**< enum value is extension code . */
|
||||||
|
|
||||||
|
|
||||||
|
} PushActionResultCode;
|
||||||
|
class ProtocolPush;
|
||||||
|
/**
|
||||||
|
*@class PushActionListener
|
||||||
|
*@brief the interface of Push callback
|
||||||
|
*/
|
||||||
|
class PushActionListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of Push callback
|
||||||
|
*@param the adatper of plugin
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onActionResult(ProtocolPush* pPlugin, PushActionResultCode code, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @class ProtocolPush
|
||||||
|
*/
|
||||||
|
class ProtocolPush : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief start/register Push services
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void startPush() = 0 ;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief close Push services
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void closePush() = 0 ;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief set alias
|
||||||
|
*@param tags
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void setAlias(string alias) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief del alias
|
||||||
|
*@param tags
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void delAlias(string alias) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief set tag
|
||||||
|
*@param tags
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void setTags(list<string> tags) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@brief delete tag
|
||||||
|
*@param tags
|
||||||
|
*@return void
|
||||||
|
*/
|
||||||
|
virtual void delTags(list<string> tags) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief set the result listener
|
||||||
|
@param pListener The callback object for push result
|
||||||
|
*/
|
||||||
|
virtual void setActionListener(PushActionListener* listener) = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief get pListener The callback object for Push result
|
||||||
|
@return the listener
|
||||||
|
*/
|
||||||
|
virtual PushActionListener* getActionListener() = 0 ;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PROTOCOL_PUSH_H__ */
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
/** @file ProtocolREC.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_REC_H__
|
||||||
|
#define __CCX_PROTOCOL_REC_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
typedef std::map<std::string, std::string> TVideoInfo;
|
||||||
|
|
||||||
|
/** @brief RECResultCode enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kRECInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk . */
|
||||||
|
kRECInitFail,/**< enum value is callback of failing to init sdk. */
|
||||||
|
kRECStartRecording,/**< enum value is callback of starting to record. */
|
||||||
|
kRECStopRecording,/**< enum value is callback of stoping to record. */
|
||||||
|
kRECPauseRecording,/**< enum value is callback of pausing to record. */
|
||||||
|
kRECResumeRecording,/**< enum value is callback of resuming to record. */
|
||||||
|
kRECEnterSDKPage,/**< enum value is callback of entering SDK`s page. */
|
||||||
|
kRECQuitSDKPage,/**< enum value is callback of quiting SDK`s page. */
|
||||||
|
kRECShareSuccess,/**< enum value is callback of succeeding in sharing. */
|
||||||
|
kRECShareFail,/**< enum value is callback of failing to share. */
|
||||||
|
kRECExtension = 90000 /**< enum value is extension code . */
|
||||||
|
} RECResultCode;
|
||||||
|
/**
|
||||||
|
*@class RECResultListener
|
||||||
|
*@brief the interface of REC callback
|
||||||
|
*/
|
||||||
|
class RECResultListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of REC callback
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onRECResult(RECResultCode ret, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
*@class ProtocolREC
|
||||||
|
*@brief the interface of REC
|
||||||
|
*/
|
||||||
|
class ProtocolREC : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: Start to record video
|
||||||
|
*/
|
||||||
|
virtual void startRecording() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: Stop to record video
|
||||||
|
*/
|
||||||
|
virtual void stopRecording() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: share video
|
||||||
|
* @Param info The info of share
|
||||||
|
*/
|
||||||
|
virtual void share(TVideoInfo info) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@breif set the result listener
|
||||||
|
@param pListener The callback object for REC result
|
||||||
|
@wraning Must invoke this interface before REC
|
||||||
|
*/
|
||||||
|
virtual void setResultListener(RECResultListener* pListener) = 0;
|
||||||
|
|
||||||
|
virtual RECResultListener* getRECListener() = 0;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
/** @file ProtocolShare.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_SHARE_H__
|
||||||
|
#define __CCX_PROTOCOL_SHARE_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/// \typedef std::map<std::string, std::string> TShareDeveloperInfo
|
||||||
|
/// typedef TShareDeveloperInfo.
|
||||||
|
typedef std::map<std::string, std::string> TShareDeveloperInfo;
|
||||||
|
/// \typedef std::map<std::string, std::string> TShareInfo
|
||||||
|
/// typedef TShareInfo.
|
||||||
|
typedef std::map<std::string, std::string> TShareInfo;
|
||||||
|
/** @brief ShareResultCode enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kShareSuccess = 0,/**< enum value is callback of failing to sharing . */
|
||||||
|
kShareFail,/**< enum value is callback of failing to share . */
|
||||||
|
kShareCancel,/**< enum value is callback of canceling to share . */
|
||||||
|
kShareNetworkError,/**< enum value is callback of network error . */
|
||||||
|
kShareExtension = 10000 /**< enum value is extension code . */
|
||||||
|
} ShareResultCode;
|
||||||
|
/**
|
||||||
|
*@class ShareResultListener
|
||||||
|
*@brief the interface of share callback
|
||||||
|
*/
|
||||||
|
class ShareResultListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of share callback
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onShareResult(ShareResultCode ret, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
*@class ProtocolShare
|
||||||
|
*@brief the interface of share
|
||||||
|
*/
|
||||||
|
class ProtocolShare : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief share information
|
||||||
|
@param info The info of share, contains key:
|
||||||
|
SharedText The text need to share
|
||||||
|
SharedImagePath The full path of image file need to share (optinal)
|
||||||
|
@warning For different plugin, the parameter should have other keys to share.
|
||||||
|
Look at the manual of plugins. */
|
||||||
|
virtual void share(TShareInfo info) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@breif set the result listener
|
||||||
|
@param pListener The callback object for share result
|
||||||
|
@wraning Must invoke this interface before share
|
||||||
|
*/
|
||||||
|
virtual void setResultListener(ShareResultListener* pListener) = 0;
|
||||||
|
|
||||||
|
virtual ShareResultListener* getShareListener() = 0;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
/** @file ProtocolSocial.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_SOCIAL_H__
|
||||||
|
#define __CCX_PROTOCOL_SOCIAL_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/// \typedef std::map<std::string, std::string> TSocialDeveloperInfo
|
||||||
|
/// typedef TSocialDeveloperInfo.
|
||||||
|
typedef std::map<std::string, std::string> TSocialDeveloperInfo;
|
||||||
|
/// \typedef std::map<std::string, std::string> TAchievementInfo
|
||||||
|
/// typedef TAchievementInfo.
|
||||||
|
typedef std::map<std::string, std::string> TAchievementInfo;
|
||||||
|
/** @brief SocialRetCode enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
// code for leaderboard feature
|
||||||
|
kScoreSubmitSucceed =1,/**< enum value is callback of succeeding in submiting. */
|
||||||
|
kScoreSubmitfail,/**< enum value is callback of failing to submit . */
|
||||||
|
|
||||||
|
// code for achievement feature
|
||||||
|
kAchUnlockSucceed,/**< enum value is callback of succeeding in unlocking. */
|
||||||
|
kAchUnlockFail,/**< enum value is callback of failing to unlock. */
|
||||||
|
|
||||||
|
kSocialSignInSucceed,/**< enum value is callback of succeeding to login. */
|
||||||
|
kSocialSignInFail,/**< enum value is callback of failing to login. */
|
||||||
|
|
||||||
|
kSocialSignOutSucceed,/**< enum value is callback of succeeding to login. */
|
||||||
|
kSocialSignOutFail,/**< enum value is callback of failing to login. */
|
||||||
|
kSocialGetGameFriends,/**< enum value is callback of getGameFriends. */
|
||||||
|
kSocialExtensionCode = 20000 /**< enum value is extension code . */
|
||||||
|
|
||||||
|
} SocialRetCode;
|
||||||
|
/**
|
||||||
|
*@class SocialListener
|
||||||
|
*@brief the interface of social callback
|
||||||
|
*/
|
||||||
|
class SocialListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of social callback
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onSocialResult(SocialRetCode code, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@class ProtocolSocial
|
||||||
|
*@brief the interface of social
|
||||||
|
*/
|
||||||
|
class ProtocolSocial : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief user signIn
|
||||||
|
*/
|
||||||
|
virtual void signIn() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief user signOut
|
||||||
|
*/
|
||||||
|
virtual void signOut() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief submit the score
|
||||||
|
@param leaderboardID
|
||||||
|
@param the score
|
||||||
|
*/
|
||||||
|
virtual void submitScore(const char* leadboardID, long score) = 0;
|
||||||
|
/**
|
||||||
|
@brief show the id of Leaderboard page
|
||||||
|
@param leaderboardID
|
||||||
|
*/
|
||||||
|
virtual void showLeaderboard(const char* leaderboardID) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief methods of achievement feature
|
||||||
|
@param the info of achievement
|
||||||
|
*/
|
||||||
|
virtual void unlockAchievement(TAchievementInfo achInfo) = 0;
|
||||||
|
/**
|
||||||
|
@brief show the page of achievements
|
||||||
|
*/
|
||||||
|
virtual void showAchievements() = 0;
|
||||||
|
/**
|
||||||
|
@brief set pListener The callback object for social result
|
||||||
|
@param the listener
|
||||||
|
*/
|
||||||
|
virtual void setListener(SocialListener* listener) = 0;
|
||||||
|
/**
|
||||||
|
@brief get pListener The callback object for social result
|
||||||
|
@return the listener
|
||||||
|
*/
|
||||||
|
virtual SocialListener* getListener() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* ----- #ifndef __CCX_PROTOCOL_SOCIAL_H__ ----- */
|
||||||
|
|
@ -0,0 +1,135 @@
|
||||||
|
/** @file ProtocolUser.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_USER_H__
|
||||||
|
#define __CCX_PROTOCOL_USER_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/// \typedef std::map<std::string, std::string> TUserDeveloperInfo
|
||||||
|
/// typedef TUserDeveloperInfo.
|
||||||
|
typedef std::map<std::string, std::string> TUserDeveloperInfo;
|
||||||
|
/** @brief Plugin_type enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk. */
|
||||||
|
kInitFail,/**< enum value is callback of failing to init sdk. */
|
||||||
|
kLoginSuccess,/**< enum value is callback of succeeding in login.*/
|
||||||
|
kLoginNetworkError,/**< enum value is callback of network error*/
|
||||||
|
kLoginNoNeed,/**< enum value is callback of no need login.*/
|
||||||
|
kLoginFail,/**< enum value is callback of failing to login. */
|
||||||
|
kLoginCancel,/**< enum value is callback of canceling to login. */
|
||||||
|
kLogoutSuccess,/**< enum value is callback of succeeding in logout. */
|
||||||
|
kLogoutFail,/**< enum value is callback of failing to logout. */
|
||||||
|
kPlatformEnter,/**< enum value is callback after enter platform. */
|
||||||
|
kPlatformBack,/**< enum value is callback after exit antiAddiction. */
|
||||||
|
kPausePage,/**< enum value is callback after exit pause page. */
|
||||||
|
kExitPage,/**< enum value is callback after exit exit page. */
|
||||||
|
kAntiAddictionQuery,/**< enum value is callback after querying antiAddiction. */
|
||||||
|
kRealNameRegister,/**< enum value is callback after registering realname. */
|
||||||
|
kAccountSwitchSuccess,/**< enum value is callback of succeeding in switching account. */
|
||||||
|
kAccountSwitchFail,/**< enum value is callback of failing to switch account. */
|
||||||
|
kOpenShop,/**< enum value is callback of open the shop. */
|
||||||
|
kAccountSwitchCancel,/**< enum value is callback of canceling to switch account. */
|
||||||
|
kGameExitPage,/**< enum value is callback of no channel exit page. */
|
||||||
|
kUserExtension = 50000 /**< enum value is extension code . */
|
||||||
|
|
||||||
|
|
||||||
|
} UserActionResultCode;
|
||||||
|
/** @brief ToolBarPlace enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kToolBarTopLeft = 1,/**< enum the toolbar is at topleft. */
|
||||||
|
kToolBarTopRight,/**< enum the toolbar is at topright. */
|
||||||
|
kToolBarMidLeft,/**< enum the toolbar is at midleft. */
|
||||||
|
kToolBarMidRight,/**< enum the toolbar is at midright. */
|
||||||
|
kToolBarBottomLeft,/**< enum the toolbar is at bottomleft. */
|
||||||
|
kToolBarBottomRight,/**< enum the toolbar is at bottomright. */
|
||||||
|
} ToolBarPlace;
|
||||||
|
|
||||||
|
class ProtocolUser;
|
||||||
|
/**
|
||||||
|
*@class UserActionListener
|
||||||
|
*@brief the interface of user callback
|
||||||
|
*/
|
||||||
|
class UserActionListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of user callback
|
||||||
|
*@param the adatper of plugin
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*/
|
||||||
|
virtual void onActionResult(ProtocolUser* pPlugin, UserActionResultCode code, const char* msg) = 0;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @class ProtocolUser
|
||||||
|
*/
|
||||||
|
class ProtocolUser : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief User login
|
||||||
|
*/
|
||||||
|
virtual void login() = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief User login
|
||||||
|
if the process of logining need to know the param of server_id ,
|
||||||
|
you can use the function
|
||||||
|
and if you must change oauthloginserver, you can add the param of oauthLoginServer
|
||||||
|
@param server_id
|
||||||
|
@param oauthLoginServer
|
||||||
|
*/
|
||||||
|
|
||||||
|
CC_DEPRECATED_ATTRIBUTE virtual void login(std::string server_id, std::string oauthLoginServer = "") = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief User login
|
||||||
|
if the process of logining need to know the parameters ,
|
||||||
|
you can use the function
|
||||||
|
@param the parameters
|
||||||
|
*/
|
||||||
|
virtual void login(std::map<std::string, std::string> info) = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Check whether the user logined or not
|
||||||
|
@return If user logined, return value is true;
|
||||||
|
else return value is false.
|
||||||
|
*/
|
||||||
|
virtual bool isLogined() = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Get USER ID
|
||||||
|
@return If user logined, return value is userID;
|
||||||
|
else return value is empty string.
|
||||||
|
*/
|
||||||
|
virtual std::string getUserID() = 0 ;
|
||||||
|
/**
|
||||||
|
@brief set the result listener
|
||||||
|
@param pListener The callback object for user result
|
||||||
|
*/
|
||||||
|
virtual void setActionListener(UserActionListener* listener) = 0 ;
|
||||||
|
/**
|
||||||
|
@brief get pListener The callback object for user result
|
||||||
|
@return the listener
|
||||||
|
*/
|
||||||
|
virtual UserActionListener* getActionListener() = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief get plugin id
|
||||||
|
@return the plugin id
|
||||||
|
*/
|
||||||
|
virtual std::string getPluginId() = 0 ;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PROTOCOL_USER_H__ */
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
/** @file ProtocolYAP.h
|
||||||
|
*/
|
||||||
|
#ifndef __CCX_PROTOCOL_YAP_H__
|
||||||
|
#define __CCX_PROTOCOL_YAP_H__
|
||||||
|
|
||||||
|
#include "PluginProtocol.h"
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
namespace anysdk { namespace framework {
|
||||||
|
/// \typedef std::map<std::string, std::string> TYAPDeveloperInfo
|
||||||
|
/// typedef TYAPDeveloperInfo.
|
||||||
|
typedef std::map<std::string, std::string> TYAPDeveloperInfo;
|
||||||
|
/// \typedef std::map<std::string, std::string> TProductInfo
|
||||||
|
/// typedef TProductInfo.
|
||||||
|
typedef std::map<std::string, std::string> TProductInfo;
|
||||||
|
/// typedef TProductsInfo.
|
||||||
|
typedef std::map<std::string, TProductInfo> AllProductsInfo;
|
||||||
|
/** @brief YapResultCode enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kYapSuccess = 0,/**< enum value is callback of succeeding in yaping . */
|
||||||
|
kYapFail,/**< enum value is callback of failing to yap . */
|
||||||
|
kYapCancel,/**< enum value is callback of canceling to yap . */
|
||||||
|
kYapNetworkError,/**< enum value is callback of network error . */
|
||||||
|
kYapProductionInforIncomplete,/**< enum value is callback of incompleting info . */
|
||||||
|
kYapInitSuccess,/**< enum value is callback of succeeding in initing sdk . */
|
||||||
|
kYapInitFail,/**< enum value is callback of failing to init sdk . */
|
||||||
|
kYapNowYaping,/**< enum value is callback of yaping now . */
|
||||||
|
kYapRechargeSuccess,/**< enum value is callback of succeeding in recharging. */
|
||||||
|
kYapExtension = 30000 /**< enum value is extension code . */
|
||||||
|
} YapResultCode;
|
||||||
|
/** @brief RequestResultCode enum, with inline docs */
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
kRequestSuccess = 31000,/**< enum value is callback of succeeding in yaping . */
|
||||||
|
kRequestFail/**< enum value is callback of failing to yap . */
|
||||||
|
} RequestResultCode;
|
||||||
|
/**
|
||||||
|
*@class YapResultListener
|
||||||
|
*@brief the interface of yap callback
|
||||||
|
*/
|
||||||
|
class YapResultListener
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
*@brief the interface of yap callback
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*@param the info of yap
|
||||||
|
*/
|
||||||
|
virtual void onYapResult(YapResultCode ret, const char* msg, TProductInfo info) = 0;
|
||||||
|
/**
|
||||||
|
*@brief the interface of request callback
|
||||||
|
*@param the id of callback
|
||||||
|
*@param the information of callback
|
||||||
|
*@param the info of request product
|
||||||
|
*/
|
||||||
|
virtual void onRequestResult(RequestResultCode ret, const char* msg, AllProductsInfo info) {}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
*@class ProtocolYAP
|
||||||
|
*@brief the interface of yap
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ProtocolYAP : public PluginProtocol
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief yap for product
|
||||||
|
@param info The info of product, must contains key:
|
||||||
|
productName The name of product
|
||||||
|
productPrice The price of product(must can be parse to float)
|
||||||
|
productDesc The description of product
|
||||||
|
@warning For different plugin, the parameter should have other keys to yap.
|
||||||
|
Look at the manual of plugins.
|
||||||
|
*/
|
||||||
|
virtual void yapForProduct(TProductInfo info) = 0;
|
||||||
|
/**
|
||||||
|
@brief get order id
|
||||||
|
@return the order id
|
||||||
|
*/
|
||||||
|
virtual std::string getOrderId() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@breif set the result listener
|
||||||
|
@param pListener The callback object for yap result
|
||||||
|
@wraning Must invoke this interface before yapForProduct.
|
||||||
|
*/
|
||||||
|
virtual void setResultListener(YapResultListener* pListener) = 0;
|
||||||
|
|
||||||
|
virtual YapResultListener* getYapListener() = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief get plugin id
|
||||||
|
@return the plugin id
|
||||||
|
*/
|
||||||
|
virtual std::string getPluginId() = 0 ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief change the state of yaping
|
||||||
|
@param the state
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void resetYapState()
|
||||||
|
{
|
||||||
|
_yaping = false;
|
||||||
|
}
|
||||||
|
static bool _yaping;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
}} // namespace anysdk { namespace framework {
|
||||||
|
|
||||||
|
#endif /* __CCX_PROTOCOL_YAP_H__ */
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
//
|
||||||
|
// PushWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-10-9.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ACTION_RET_RECEIVEMESSAGE = 0,/**value is callback of Receiving Message . */
|
||||||
|
ACTION_RET_PUSHEXTENSION = 60000 /**value is extension code . */
|
||||||
|
} PUSH_RET_CODE;
|
||||||
|
|
||||||
|
@interface PushWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* the callback interface of push system
|
||||||
|
*
|
||||||
|
* @param pPlugin the push plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void) onActionResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
//
|
||||||
|
// RECWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
RECRESULT_RECINITSUCCESSS = 0,/**< enum value is callback of succeeding in initing sdk . */
|
||||||
|
RECRESULT_RECINITFAIL,/**< enum value is callback of failing to init sdk. */
|
||||||
|
RECRESULT_RECSTARTRECORDING,/**< enum value is callback of starting to record. */
|
||||||
|
RECRESULT_RECSTOPRECORDING,/**< enum value is callback of stoping to record. */
|
||||||
|
RECRESULT_RECPAUSEECORDING,/**< enum value is callback of pausing to record. */
|
||||||
|
RECRESULT_RECRESUMERECORDING,/**< enum value is callback of resuming to record. */
|
||||||
|
RECRESULT_RECENTERSDKPAGE,/**< enum value is callback of entering SDK`s page. */
|
||||||
|
RECRESULT_RECQUITSDKPAGE,/**< enum value is callback of quiting SDK`s page. */
|
||||||
|
RECRESULT_RECSHARESUCCESS,/**< enum value is callback of succeeding in sharing. */
|
||||||
|
RECRESULT_RECSHAREFAIL,/**< enum value is callback of failing to share. */
|
||||||
|
RECRESULT_RECEXTENSION = 90000 /**< enum value is extension code . */
|
||||||
|
} REC_RET_CODE;
|
||||||
|
|
||||||
|
@interface RECWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback interface of REC system
|
||||||
|
*
|
||||||
|
* @param pPlugin the REC plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void) onRECResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
// SdkHttpListener.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-9-9.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
//@protocol <NSObject>
|
||||||
|
@protocol SdkHttpListener <NSObject>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* network response
|
||||||
|
*
|
||||||
|
* @param response the response message
|
||||||
|
*/
|
||||||
|
- (void) onResponse:(NSString*)response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* network return error
|
||||||
|
*/
|
||||||
|
- (void) onError;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
//
|
||||||
|
// ShareWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-11-12.
|
||||||
|
// Copyright (c) 2014年 zhangbin. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
SHARERESULT_SUCCESS = 0,/**< enum value is callback of failing to sharing . */
|
||||||
|
SHARERESULT_FAIL,/**< enum value is callback of failing to share . */
|
||||||
|
SHARERESULT_CANCEL,/**< enum value is callback of canceling to share . */
|
||||||
|
SHARERESULT_NETWORK_ERROR, /**< enum value is callback of network error . */
|
||||||
|
SHARERESULT_SHAREEXTENSION = 10000 /**< enum value is extension code . */
|
||||||
|
} SHARE_RET_CODE;
|
||||||
|
|
||||||
|
@interface ShareWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback interface of share system
|
||||||
|
*
|
||||||
|
* @param pPlugin the share plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void) onShareResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
//
|
||||||
|
// SocialWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-10-9.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
// code for leaderboard feature
|
||||||
|
SOCIAL_SUBMITSCORE_SUCCEED = 0,/**< enum value is callback of succeeding in submiting. */
|
||||||
|
SOCIAL_SUBMITSCORE_FAIL,/**< enum value is callback of failing to submit . */
|
||||||
|
// code for achievement feature
|
||||||
|
SOCIAL_UNLOCKACH_SUCCEED,/**< enum value is callback of succeeding in unlocking. */
|
||||||
|
SOCIAL_UNLOCKACH_FAIL,/**< enum value is callback of failing to unlock. */
|
||||||
|
SOCIAL_SIGNIN_SUCCEED,/**< enum value is callback of succeeding to login. */
|
||||||
|
SOCIAL_SIGNIN_FAIL,/**< enum value is callback of failing to login. */
|
||||||
|
SOCIAL_SIGNOUT_SUCCEED,/**< enum value is callback of succeeding to login. */
|
||||||
|
SOCIAL_SIGNOUT_FAIL ,/**< enum value is callback of failing to login. */
|
||||||
|
SOCIAL_GET_GAME_FRIENDS,/**< enum value is callback of getGameFriends. */
|
||||||
|
SOCIAL_SOCIALEXTENSION = 20000/**< enum value is extension code . */
|
||||||
|
} SOCIAL_RET_CODE;
|
||||||
|
|
||||||
|
@interface SocialWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback interface of social system
|
||||||
|
*
|
||||||
|
* @param pPlugin the social plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void) onSocialResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
//
|
||||||
|
// UserWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-9-4.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "InterfaceUser.h"
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ACTION_RET_INIT_SUCCESS = 0,/**< enum value is callback of succeeding in initing sdk. */
|
||||||
|
ACTION_RET_INIT_FAIL,/**< enum value is callback of failing to init sdk. */
|
||||||
|
ACTION_RET_LOGIN_SUCCESS,/**< enum value is callback of succeeding in login.*/
|
||||||
|
ACTION_RET_LOGIN_TIMEOUT,/**< enum value is callback of network error*/
|
||||||
|
ACTION_RET_LOGIN_NO_NEED,/**< enum value is callback of no need login.*/
|
||||||
|
ACTION_RET_LOGIN_FAIL,/**< enum value is callback of failing to login. */
|
||||||
|
ACTION_RET_LOGIN_CANCEL,/**< enum value is callback of canceling to login. */
|
||||||
|
ACTION_RET_LOGOUT_SUCCESS,/**< enum value is callback of succeeding in logout. */
|
||||||
|
ACTION_RET_LOGOUT_FAIL,/**< enum value is callback of failing to logout. */
|
||||||
|
ACTION_RET_PLATFORM_ENTER,/**< enum value is callback after enter platform. */
|
||||||
|
ACTION_RET_PLATFORM_BACK,/**< enum value is callback after exit antiAddiction. */
|
||||||
|
ACTION_RET_PAUSE_PAGE,/**< enum value is callback after exit pause page. */
|
||||||
|
ACTION_RET_EXIT_PAGE,/**< enum value is callback after exit exit page. */
|
||||||
|
ACTION_RET_ANTIADDICTIONQUERY,/**< enum value is callback after querying antiAddiction. */
|
||||||
|
ACTION_RET_REALNAMEREGISTER,/**< enum value is callback after registering realname. */
|
||||||
|
ACTION_RET_ACCOUNTSWITCH_SUCCESS,/**< enum value is callback of succeeding in switching account. */
|
||||||
|
ACTION_RET_ACCOUNTSWITCH_FAIL,/**< enum value is callback of failing to switch account. */
|
||||||
|
ACTION_RET_OPENSHOP,/**< enum value is callback of open the shop. */
|
||||||
|
ACTION_RET_ACCOUNTSWITCH_CANCEL,/**< enum value is callback of canceling to switch account. */
|
||||||
|
ACTION_RET_GAME_EXIT_PAGE,/**< enum value is callback of no channel exit page. */
|
||||||
|
ACTION_RET_USEREXTENSION = 50000 /**< enum value is extension code . */
|
||||||
|
|
||||||
|
} USER_RET_CODE;
|
||||||
|
|
||||||
|
@interface UserWrapper : NSObject
|
||||||
|
/**
|
||||||
|
* The callback interface of user system
|
||||||
|
*
|
||||||
|
* @param pPlugin the user plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void) onActionResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The login authentication
|
||||||
|
*
|
||||||
|
* @param data the parameters
|
||||||
|
* @param target target description
|
||||||
|
* @param sel sel description
|
||||||
|
*/
|
||||||
|
+ (void) getAccessToken:(NSMutableDictionary*)data target:(id)target sel:(SEL)sel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @Title: relaceLoginOauthURL
|
||||||
|
* @Description:According to server,it changes login oauth url http://changed_host/
|
||||||
|
* @return replace url
|
||||||
|
*/
|
||||||
|
+ (NSString*)replaceLoginOauthURL:url;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
//
|
||||||
|
// Wrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-8-29.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "CocosRuntimeDelegate.h"
|
||||||
|
|
||||||
|
@interface Wrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* init developer.xml
|
||||||
|
*/
|
||||||
|
+ (void) analysisDeveloperInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check application
|
||||||
|
*
|
||||||
|
* @param appKey the value of appkey from AnySDK Client
|
||||||
|
* @param appSeceret the value of appSeceret from AnySDK Client
|
||||||
|
* @param privateKey the value of privateKey from AnySDK Client
|
||||||
|
* @param oauthLoginServer the value of appkey from AnySDK Client
|
||||||
|
*/
|
||||||
|
+ (void) setAppParam:(const char*)appKey AppSecret:(const char*)appSeceret PrivateKey:(const char*)privateKey OauthLoginServer:(const char*)oauthLoginServer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the parameters of SDK
|
||||||
|
*
|
||||||
|
* @return the parameters of SDK
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getDeveloperInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the information of channel
|
||||||
|
*
|
||||||
|
* @return the information of channel
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getChannelInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the information of game
|
||||||
|
*
|
||||||
|
* @return the information of game
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getGameInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the information of plugin
|
||||||
|
*
|
||||||
|
* @return the information of plugin
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getPluginInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the information of tool
|
||||||
|
*
|
||||||
|
* @return the information of tool
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getToolInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get support for plug-ins
|
||||||
|
*
|
||||||
|
* @return support for plug-ins
|
||||||
|
*/
|
||||||
|
+ (NSMutableArray*) getSupportForPlugins;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NSMutableDictionary change to NSString
|
||||||
|
*
|
||||||
|
* @param dict NSMutableDictionary value
|
||||||
|
*
|
||||||
|
* @return NSString value
|
||||||
|
*/
|
||||||
|
+ (NSString*)dictToNSString:(NSMutableDictionary*)dict;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the identifier of value
|
||||||
|
*
|
||||||
|
* @return the identifier of value
|
||||||
|
*/
|
||||||
|
+ (NSString*)getChannelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get custom parameter from AnySDK Client
|
||||||
|
*
|
||||||
|
* @return return value description
|
||||||
|
*/
|
||||||
|
+ (NSString*) getCustomParam;
|
||||||
|
|
||||||
|
+ (BOOL)networkReachable;
|
||||||
|
|
||||||
|
+ (NSString*) replaceNotifyURL:(Class)class1 url:(NSString*)url;
|
||||||
|
|
||||||
|
+ (void)reset;
|
||||||
|
|
||||||
|
//about cocos runtime
|
||||||
|
+ (id<CocosRuntimeSDKDelegate>)getCocosRuntimeSDKProxy;
|
||||||
|
|
||||||
|
+ (void)setCocosRuntimeSDKProxy:(id<CocosRuntimeSDKDelegate>)runtimeProxy;
|
||||||
|
|
||||||
|
+ (int)getCocosRuntimeSDKVersionCode;
|
||||||
|
|
||||||
|
+ (void)setCocosRuntimeSDKVersionCode:(int)sdkVersionCode;
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
//
|
||||||
|
// YAPWrapper.h
|
||||||
|
// PluginProtocol
|
||||||
|
//
|
||||||
|
// Created by cocos2dx on 14-9-9.
|
||||||
|
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
YAPRESULT_SUCCESS = 0,/**< enum value is callback of succeeding in yaping . */
|
||||||
|
YAPRESULT_FAIL,/**< enum value is callback of failing to yap . */
|
||||||
|
YAPRESULT_CANCEL,/**< enum value is callback of canceling to yap . */
|
||||||
|
YAPRESULT_NETWORK_ERROR,/**< enum value is callback of network error . */
|
||||||
|
YAPRESULT_PRODUCTIONINFOR_INCOMPLETE,/**< enum value is callback of incompleting info . */
|
||||||
|
YAPRESULT_INIT_SUCCESS,/**< enum value is callback of succeeding in initing sdk . */
|
||||||
|
YAPRESULT_INIT_FAIL,/**< enum value is callback of failing to init sdk . */
|
||||||
|
YAPRESULT_NOW_YAPING,/**< enum value is callback of yaping now . */
|
||||||
|
YAPRESULT_YAPEXTENSION = 30000 /**< enum value is extension code . */
|
||||||
|
} YAP_RET_CODE;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
REQUESTRESULT_SUCCESS = 31000,/**< enum value is callback of succeeding in yaping . */
|
||||||
|
REQUESTRESULT_FAIL/**< enum value is callback of failing to yap . */
|
||||||
|
} REQUEST_RET_CODE;
|
||||||
|
|
||||||
|
@interface YAPWrapper : NSObject
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the identifier of order
|
||||||
|
*
|
||||||
|
* @param orderInfo yapment info
|
||||||
|
* @param target callback object
|
||||||
|
* @param action callback function
|
||||||
|
*/
|
||||||
|
+ (void)getYapOrderId:(NSMutableDictionary*)orderInfo target:(id)target action:(SEL)action;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get order info
|
||||||
|
*
|
||||||
|
* @param productInfo product info
|
||||||
|
* @param user identifier of user
|
||||||
|
*
|
||||||
|
* @return order info
|
||||||
|
*/
|
||||||
|
+ (NSMutableDictionary*) getOrderInfo:(NSMutableDictionary*)productInfo userID:(NSString*)user;
|
||||||
|
/**
|
||||||
|
* The callback interface of yap system
|
||||||
|
*
|
||||||
|
* @param pPlugin the yap plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void)onYapResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The callback interface of social system
|
||||||
|
*
|
||||||
|
* @param pPlugin the social plugin
|
||||||
|
* @param ret the code of callback
|
||||||
|
* @param msg the message of callback
|
||||||
|
*/
|
||||||
|
+ (void)onYapResult:(id)pPlugin retCode:(int)ret products:(NSMutableDictionary*)products;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* process the notify url
|
||||||
|
*
|
||||||
|
* @param class1 plugin
|
||||||
|
* @param url the source url
|
||||||
|
*
|
||||||
|
* @return the destination url
|
||||||
|
*/
|
||||||
|
+ (NSString*) replaceNotifyURL:(Class)class1 url:(NSString*)url;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* process the EE Domain
|
||||||
|
*
|
||||||
|
* @param domain
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
+ (void)replaceEEDomain:(NSString*)domain;
|
||||||
|
|
||||||
|
@end
|
||||||
Binary file not shown.
Loading…
Reference in New Issue