Compare commits
12
Commits
v3-deps-38
...
v3-deps-45
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0da6174d5 | ||
|
|
82dd97d1d0 | ||
|
|
9d28237353 | ||
|
|
3c94680588 | ||
|
|
4710400999 | ||
|
|
4d6ccead0b | ||
|
|
c6c14b8463 | ||
|
|
32c21bc388 | ||
|
|
844509e61a | ||
|
|
4ea54c180d | ||
|
|
306402354e | ||
|
|
5c90ba54d3 |
@@ -117,6 +117,59 @@ LOCAL_EXPORT_CPPFLAGS := -D__STDC_LIMIT_MACROS=1 -Wno-invalid-offsetof
|
||||
LOCAL_STATIC_LIBRARIES += cocos_mozglue_static
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_builtins_generators
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_builtins_generators.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_builtins_setup
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_builtins_setup.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_libbase
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_libbase.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_libplatform
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_libplatform.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_libsampler
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_libsampler.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_nosnapshot
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_nosnapshot.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := v8_inspector
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libinspector.a
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := v8_static
|
||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libv8_base.a
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/$(TARGET_ARCH_ABI)/include/v8
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += v8_builtins_generators v8_builtins_setup v8_libbase v8_libplatform v8_libsampler v8_nosnapshot v8_inspector
|
||||
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
#======================================
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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,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,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) 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,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,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,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,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
|
||||
@@ -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,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,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,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,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,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__ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user