diff --git a/ios/include/anysdk/AdsUtil.h b/ios/include/anysdk/common/AdsUtil.h similarity index 100% rename from ios/include/anysdk/AdsUtil.h rename to ios/include/anysdk/common/AdsUtil.h diff --git a/ios/include/anysdk/AdsWrapper.h b/ios/include/anysdk/common/AdsWrapper.h similarity index 100% rename from ios/include/anysdk/AdsWrapper.h rename to ios/include/anysdk/common/AdsWrapper.h diff --git a/ios/include/anysdk/AgentManager.h b/ios/include/anysdk/common/AgentManager.h similarity index 100% rename from ios/include/anysdk/AgentManager.h rename to ios/include/anysdk/common/AgentManager.h diff --git a/ios/include/anysdk/AnalyticsWrapper.h b/ios/include/anysdk/common/AnalyticsWrapper.h similarity index 100% rename from ios/include/anysdk/AnalyticsWrapper.h rename to ios/include/anysdk/common/AnalyticsWrapper.h diff --git a/ios/include/anysdk/CocosRuntimeDelegate.h b/ios/include/anysdk/common/CocosRuntimeDelegate.h similarity index 100% rename from ios/include/anysdk/CocosRuntimeDelegate.h rename to ios/include/anysdk/common/CocosRuntimeDelegate.h diff --git a/ios/include/anysdk/CustomWrapper.h b/ios/include/anysdk/common/CustomWrapper.h similarity index 100% rename from ios/include/anysdk/CustomWrapper.h rename to ios/include/anysdk/common/CustomWrapper.h diff --git a/ios/include/anysdk/IAPWrapper.h b/ios/include/anysdk/common/IAPWrapper.h similarity index 100% rename from ios/include/anysdk/IAPWrapper.h rename to ios/include/anysdk/common/IAPWrapper.h diff --git a/ios/include/anysdk/InterfaceAdTracking.h b/ios/include/anysdk/common/InterfaceAdTracking.h similarity index 100% rename from ios/include/anysdk/InterfaceAdTracking.h rename to ios/include/anysdk/common/InterfaceAdTracking.h diff --git a/ios/include/anysdk/InterfaceAds.h b/ios/include/anysdk/common/InterfaceAds.h similarity index 100% rename from ios/include/anysdk/InterfaceAds.h rename to ios/include/anysdk/common/InterfaceAds.h diff --git a/ios/include/anysdk/InterfaceAnalytics.h b/ios/include/anysdk/common/InterfaceAnalytics.h similarity index 100% rename from ios/include/anysdk/InterfaceAnalytics.h rename to ios/include/anysdk/common/InterfaceAnalytics.h diff --git a/ios/include/anysdk/InterfaceCrash.h b/ios/include/anysdk/common/InterfaceCrash.h similarity index 100% rename from ios/include/anysdk/InterfaceCrash.h rename to ios/include/anysdk/common/InterfaceCrash.h diff --git a/ios/include/anysdk/InterfaceCustom.h b/ios/include/anysdk/common/InterfaceCustom.h similarity index 100% rename from ios/include/anysdk/InterfaceCustom.h rename to ios/include/anysdk/common/InterfaceCustom.h diff --git a/ios/include/anysdk/InterfaceIAP.h b/ios/include/anysdk/common/InterfaceIAP.h similarity index 100% rename from ios/include/anysdk/InterfaceIAP.h rename to ios/include/anysdk/common/InterfaceIAP.h diff --git a/ios/include/anysdk/InterfacePush.h b/ios/include/anysdk/common/InterfacePush.h similarity index 100% rename from ios/include/anysdk/InterfacePush.h rename to ios/include/anysdk/common/InterfacePush.h diff --git a/ios/include/anysdk/InterfaceREC.h b/ios/include/anysdk/common/InterfaceREC.h similarity index 100% rename from ios/include/anysdk/InterfaceREC.h rename to ios/include/anysdk/common/InterfaceREC.h diff --git a/ios/include/anysdk/InterfaceShare.h b/ios/include/anysdk/common/InterfaceShare.h similarity index 100% rename from ios/include/anysdk/InterfaceShare.h rename to ios/include/anysdk/common/InterfaceShare.h diff --git a/ios/include/anysdk/InterfaceSocial.h b/ios/include/anysdk/common/InterfaceSocial.h similarity index 100% rename from ios/include/anysdk/InterfaceSocial.h rename to ios/include/anysdk/common/InterfaceSocial.h diff --git a/ios/include/anysdk/InterfaceUser.h b/ios/include/anysdk/common/InterfaceUser.h similarity index 100% rename from ios/include/anysdk/InterfaceUser.h rename to ios/include/anysdk/common/InterfaceUser.h diff --git a/ios/include/anysdk/JSBRelation.h b/ios/include/anysdk/common/JSBRelation.h similarity index 100% rename from ios/include/anysdk/JSBRelation.h rename to ios/include/anysdk/common/JSBRelation.h diff --git a/ios/include/anysdk/JsonParser.h b/ios/include/anysdk/common/JsonParser.h similarity index 100% rename from ios/include/anysdk/JsonParser.h rename to ios/include/anysdk/common/JsonParser.h diff --git a/ios/include/anysdk/PluginApplicationDelegate.h b/ios/include/anysdk/common/PluginApplicationDelegate.h similarity index 100% rename from ios/include/anysdk/PluginApplicationDelegate.h rename to ios/include/anysdk/common/PluginApplicationDelegate.h diff --git a/ios/include/anysdk/PluginFactory.h b/ios/include/anysdk/common/PluginFactory.h similarity index 100% rename from ios/include/anysdk/PluginFactory.h rename to ios/include/anysdk/common/PluginFactory.h diff --git a/ios/include/anysdk/PluginHelper.h b/ios/include/anysdk/common/PluginHelper.h similarity index 100% rename from ios/include/anysdk/PluginHelper.h rename to ios/include/anysdk/common/PluginHelper.h diff --git a/ios/include/anysdk/PluginManager.h b/ios/include/anysdk/common/PluginManager.h similarity index 100% rename from ios/include/anysdk/PluginManager.h rename to ios/include/anysdk/common/PluginManager.h diff --git a/ios/include/anysdk/PluginParam.h b/ios/include/anysdk/common/PluginParam.h similarity index 100% rename from ios/include/anysdk/PluginParam.h rename to ios/include/anysdk/common/PluginParam.h diff --git a/ios/include/anysdk/PluginProtocol.h b/ios/include/anysdk/common/PluginProtocol.h similarity index 100% rename from ios/include/anysdk/PluginProtocol.h rename to ios/include/anysdk/common/PluginProtocol.h diff --git a/ios/include/anysdk/PluginWrapper.h b/ios/include/anysdk/common/PluginWrapper.h similarity index 100% rename from ios/include/anysdk/PluginWrapper.h rename to ios/include/anysdk/common/PluginWrapper.h diff --git a/ios/include/anysdk/ProtocolAdTracking.h b/ios/include/anysdk/common/ProtocolAdTracking.h similarity index 100% rename from ios/include/anysdk/ProtocolAdTracking.h rename to ios/include/anysdk/common/ProtocolAdTracking.h diff --git a/ios/include/anysdk/ProtocolAds.h b/ios/include/anysdk/common/ProtocolAds.h similarity index 100% rename from ios/include/anysdk/ProtocolAds.h rename to ios/include/anysdk/common/ProtocolAds.h diff --git a/ios/include/anysdk/ProtocolAnalytics.h b/ios/include/anysdk/common/ProtocolAnalytics.h similarity index 100% rename from ios/include/anysdk/ProtocolAnalytics.h rename to ios/include/anysdk/common/ProtocolAnalytics.h diff --git a/ios/include/anysdk/ProtocolCrash.h b/ios/include/anysdk/common/ProtocolCrash.h similarity index 100% rename from ios/include/anysdk/ProtocolCrash.h rename to ios/include/anysdk/common/ProtocolCrash.h diff --git a/ios/include/anysdk/ProtocolCustom.h b/ios/include/anysdk/common/ProtocolCustom.h similarity index 100% rename from ios/include/anysdk/ProtocolCustom.h rename to ios/include/anysdk/common/ProtocolCustom.h diff --git a/ios/include/anysdk/ProtocolIAP.h b/ios/include/anysdk/common/ProtocolIAP.h similarity index 100% rename from ios/include/anysdk/ProtocolIAP.h rename to ios/include/anysdk/common/ProtocolIAP.h diff --git a/ios/include/anysdk/ProtocolPush.h b/ios/include/anysdk/common/ProtocolPush.h similarity index 100% rename from ios/include/anysdk/ProtocolPush.h rename to ios/include/anysdk/common/ProtocolPush.h diff --git a/ios/include/anysdk/ProtocolREC.h b/ios/include/anysdk/common/ProtocolREC.h similarity index 100% rename from ios/include/anysdk/ProtocolREC.h rename to ios/include/anysdk/common/ProtocolREC.h diff --git a/ios/include/anysdk/ProtocolShare.h b/ios/include/anysdk/common/ProtocolShare.h similarity index 100% rename from ios/include/anysdk/ProtocolShare.h rename to ios/include/anysdk/common/ProtocolShare.h diff --git a/ios/include/anysdk/ProtocolSocial.h b/ios/include/anysdk/common/ProtocolSocial.h similarity index 100% rename from ios/include/anysdk/ProtocolSocial.h rename to ios/include/anysdk/common/ProtocolSocial.h diff --git a/ios/include/anysdk/ProtocolUser.h b/ios/include/anysdk/common/ProtocolUser.h similarity index 100% rename from ios/include/anysdk/ProtocolUser.h rename to ios/include/anysdk/common/ProtocolUser.h diff --git a/ios/include/anysdk/PushWrapper.h b/ios/include/anysdk/common/PushWrapper.h similarity index 100% rename from ios/include/anysdk/PushWrapper.h rename to ios/include/anysdk/common/PushWrapper.h diff --git a/ios/include/anysdk/RECWrapper.h b/ios/include/anysdk/common/RECWrapper.h similarity index 100% rename from ios/include/anysdk/RECWrapper.h rename to ios/include/anysdk/common/RECWrapper.h diff --git a/ios/include/anysdk/SdkHttpListener.h b/ios/include/anysdk/common/SdkHttpListener.h similarity index 100% rename from ios/include/anysdk/SdkHttpListener.h rename to ios/include/anysdk/common/SdkHttpListener.h diff --git a/ios/include/anysdk/ShareWrapper.h b/ios/include/anysdk/common/ShareWrapper.h similarity index 100% rename from ios/include/anysdk/ShareWrapper.h rename to ios/include/anysdk/common/ShareWrapper.h diff --git a/ios/include/anysdk/SocialWrapper.h b/ios/include/anysdk/common/SocialWrapper.h similarity index 100% rename from ios/include/anysdk/SocialWrapper.h rename to ios/include/anysdk/common/SocialWrapper.h diff --git a/ios/include/anysdk/UserWrapper.h b/ios/include/anysdk/common/UserWrapper.h similarity index 100% rename from ios/include/anysdk/UserWrapper.h rename to ios/include/anysdk/common/UserWrapper.h diff --git a/ios/include/anysdk/Wrapper.h b/ios/include/anysdk/common/Wrapper.h similarity index 100% rename from ios/include/anysdk/Wrapper.h rename to ios/include/anysdk/common/Wrapper.h diff --git a/ios/include/anysdk/jailbreak/AdsUtil.h b/ios/include/anysdk/jailbreak/AdsUtil.h new file mode 100644 index 00000000..15161729 --- /dev/null +++ b/ios/include/anysdk/jailbreak/AdsUtil.h @@ -0,0 +1,20 @@ +// +// AdsUtil.h +// PluginProtocol +// +// Created by cocos2dx on 14-9-23. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import + +@interface AdsUtil : NSObject + +/** + * get the parameters of ads system in special case + * + * @return return the parameters + */ ++ (NSMutableDictionary*)getAdsParams; + +@end diff --git a/ios/include/anysdk/jailbreak/AdsWrapper.h b/ios/include/anysdk/jailbreak/AdsWrapper.h new file mode 100644 index 00000000..03b899d0 --- /dev/null +++ b/ios/include/anysdk/jailbreak/AdsWrapper.h @@ -0,0 +1,96 @@ +// +// AdsWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-8-29. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import +#import + +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 diff --git a/ios/include/anysdk/jailbreak/AgentManager.h b/ios/include/anysdk/jailbreak/AgentManager.h new file mode 100644 index 00000000..936eadc0 --- /dev/null +++ b/ios/include/anysdk/jailbreak/AgentManager.h @@ -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 +#include + +#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* 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 _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__ */ diff --git a/ios/include/anysdk/jailbreak/AnalyticsWrapper.h b/ios/include/anysdk/jailbreak/AnalyticsWrapper.h new file mode 100644 index 00000000..c20d2d5b --- /dev/null +++ b/ios/include/anysdk/jailbreak/AnalyticsWrapper.h @@ -0,0 +1,41 @@ +// +// AnalyticsWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-10-9. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import + +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,/** + +@protocol CocosRuntimeSDKDelegate + +- (NSMutableArray*)getSupportForPlugins; +- (NSMutableDictionary*)getPluginParams; +- (NSString*)getDevelopInfo; + +@end + +#endif /* __CRT_SDK_DELEGATE_H */ diff --git a/ios/include/anysdk/jailbreak/CustomWrapper.h b/ios/include/anysdk/jailbreak/CustomWrapper.h new file mode 100644 index 00000000..2eaf6195 --- /dev/null +++ b/ios/include/anysdk/jailbreak/CustomWrapper.h @@ -0,0 +1,25 @@ +// +// CustomWrapper.h +// PluginProtocol +// +// + +#import + +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 diff --git a/ios/include/anysdk/jailbreak/InterfaceAdTracking.h b/ios/include/anysdk/jailbreak/InterfaceAdTracking.h new file mode 100644 index 00000000..67f4c224 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceAdTracking.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 + +@protocol InterfaceAdTracking + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceAds.h b/ios/include/anysdk/jailbreak/InterfaceAds.h new file mode 100644 index 00000000..da8fba35 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceAds.h @@ -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 + +@protocol InterfaceAds + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceAnalytics.h b/ios/include/anysdk/jailbreak/InterfaceAnalytics.h new file mode 100644 index 00000000..230e4c5a --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceAnalytics.h @@ -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 + +@protocol InterfaceAnalytics + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceCrash.h b/ios/include/anysdk/jailbreak/InterfaceCrash.h new file mode 100644 index 00000000..669cdd1f --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceCrash.h @@ -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 + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceCustom.h b/ios/include/anysdk/jailbreak/InterfaceCustom.h new file mode 100644 index 00000000..ea99750d --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceCustom.h @@ -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 + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfacePush.h b/ios/include/anysdk/jailbreak/InterfacePush.h new file mode 100644 index 00000000..346bd863 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfacePush.h @@ -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 + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceREC.h b/ios/include/anysdk/jailbreak/InterfaceREC.h new file mode 100644 index 00000000..43cb4635 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceREC.h @@ -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 + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceShare.h b/ios/include/anysdk/jailbreak/InterfaceShare.h new file mode 100644 index 00000000..b4cb21da --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceShare.h @@ -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 + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceSocial.h b/ios/include/anysdk/jailbreak/InterfaceSocial.h new file mode 100644 index 00000000..6f0a4e71 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceSocial.h @@ -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 + +/** + * 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 diff --git a/ios/include/anysdk/jailbreak/InterfaceUser.h b/ios/include/anysdk/jailbreak/InterfaceUser.h new file mode 100644 index 00000000..f415e364 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceUser.h @@ -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 + +@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 diff --git a/ios/include/anysdk/jailbreak/InterfaceYAP.h b/ios/include/anysdk/jailbreak/InterfaceYAP.h new file mode 100644 index 00000000..5897d087 --- /dev/null +++ b/ios/include/anysdk/jailbreak/InterfaceYAP.h @@ -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 + +@protocol InterfaceYAP + +@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 diff --git a/ios/include/anysdk/jailbreak/JSBRelation.h b/ios/include/anysdk/jailbreak/JSBRelation.h new file mode 100644 index 00000000..7775b0dc --- /dev/null +++ b/ios/include/anysdk/jailbreak/JSBRelation.h @@ -0,0 +1,31 @@ +/** @file JSBRelation.h + */ +#ifndef __CCX_JSBRELATION_H__ +#define __CCX_JSBRELATION_H__ + +#include "PluginProtocol.h" +#include +#include +#include + +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__ */ diff --git a/ios/include/anysdk/jailbreak/JsonParser.h b/ios/include/anysdk/jailbreak/JsonParser.h new file mode 100644 index 00000000..c9f4b127 --- /dev/null +++ b/ios/include/anysdk/jailbreak/JsonParser.h @@ -0,0 +1,26 @@ +// +// JsonParser.h +// PluginProtocol +// +// Created by cocos2dx on 14-9-17. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import + +@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 diff --git a/ios/include/anysdk/jailbreak/PluginApplicationDelegate.h b/ios/include/anysdk/jailbreak/PluginApplicationDelegate.h new file mode 100644 index 00000000..2af498ee --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginApplicationDelegate.h @@ -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 +@protocol PluginApplicationDelegate + +@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 diff --git a/ios/include/anysdk/jailbreak/PluginFactory.h b/ios/include/anysdk/jailbreak/PluginFactory.h new file mode 100644 index 00000000..79922c97 --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginFactory.h @@ -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__ */ diff --git a/ios/include/anysdk/jailbreak/PluginHelper.h b/ios/include/anysdk/jailbreak/PluginHelper.h new file mode 100644 index 00000000..406fc278 --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginHelper.h @@ -0,0 +1,130 @@ +// +// PluginHelper.h +// PluginProtocol +// +// Created by cocos2dx on 14-8-29. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import +#import + +@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 \ No newline at end of file diff --git a/ios/include/anysdk/jailbreak/PluginManager.h b/ios/include/anysdk/jailbreak/PluginManager.h new file mode 100644 index 00000000..93282ae7 --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginManager.h @@ -0,0 +1,51 @@ +/** @file PluginFactory.h + */ +#ifndef __CCX_PLUGINMANAGER_H__ +#define __CCX_PLUGINMANAGER_H__ + +#include "PluginProtocol.h" +#include "PluginFactory.h" +#include +#include + +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 _pluginsMap; +// bool _isDebug; +}; + +}} //namespace anysdk { namespace framework { + +#endif /* __CCX_PLUGINMANAGER_H__ */ diff --git a/ios/include/anysdk/jailbreak/PluginParam.h b/ios/include/anysdk/jailbreak/PluginParam.h new file mode 100644 index 00000000..1f35d4a7 --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginParam.h @@ -0,0 +1,126 @@ +/** @file PluginParam.h + */ +#ifndef __CCX_PLUGIN_PARAM_H__ +#define __CCX_PLUGIN_PARAM_H__ + +#include +#include +/// \typedef std::map StringMap +/// typedef YString. +typedef std::map 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 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 mapValue); + +private: + ParamType _type; + + int _intValue; + float _floatValue; + bool _boolValue; + std::string _strValue; + std::map _mapValue; + StringMap _strMapValue; +}; + +}} //namespace anysdk { namespace framework { + +#endif /* __CCX_PLUGIN_PARAM_H__ */ diff --git a/ios/include/anysdk/jailbreak/PluginProtocol.h b/ios/include/anysdk/jailbreak/PluginProtocol.h new file mode 100644 index 00000000..95cf706d --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginProtocol.h @@ -0,0 +1,144 @@ +/** @file PluginProtocol.h + */ +#ifndef __CCX_IPLUGIN_H__ +#define __CCX_IPLUGIN_H__ + +#include "PluginParam.h" +#include + +#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 params + *@return void + */ + virtual void callFuncWithParam(const char* funcName, std::vector 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 params + *@return string + */ + virtual std::string callStringFuncWithParam(const char* funcName, std::vector 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 params + *@return int + */ + virtual int callIntFuncWithParam(const char* funcName, std::vector 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 params + *@return bool + */ + virtual bool callBoolFuncWithParam(const char* funcName, std::vector 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 params + *@return float + */ + virtual float callFloatFuncWithParam(const char* funcName, std::vector 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__ */ diff --git a/ios/include/anysdk/jailbreak/PluginWrapper.h b/ios/include/anysdk/jailbreak/PluginWrapper.h new file mode 100644 index 00000000..6aa8ee94 --- /dev/null +++ b/ios/include/anysdk/jailbreak/PluginWrapper.h @@ -0,0 +1,39 @@ +// +// PluginWrapper.h +// PluginProtocol +// +#import + +#import +#import "PluginApplicationDelegate.h" +@interface PluginWrapper : NSObject + +@property (nonatomic, strong) NSMutableArray * arrayDelegate; + ++ (PluginWrapper*) getInstance; + +- (void) setDelegate:(id)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 diff --git a/ios/include/anysdk/jailbreak/ProtocolAdTracking.h b/ios/include/anysdk/jailbreak/ProtocolAdTracking.h new file mode 100644 index 00000000..402cc271 --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolAdTracking.h @@ -0,0 +1,58 @@ +/** @file ProtocolAdTracking.h + */ +#ifndef __CCX_PROTOCOL_ADTRACKING_H__ +#define __CCX_PROTOCOL_ADTRACKING_H__ + +#include "PluginProtocol.h" +#include +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 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 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* paramMap = NULL) = 0; + + +}; + +}} // namespace anysdk { namespace framework { + +#endif /* ----- #ifndef __CCX_PROTOCOL_ADTRACKING_H__ ----- */ diff --git a/ios/include/anysdk/jailbreak/ProtocolAds.h b/ios/include/anysdk/jailbreak/ProtocolAds.h new file mode 100644 index 00000000..e54d9f2f --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolAds.h @@ -0,0 +1,133 @@ +/** @file ProtocolAds.h + */ +#ifndef __CCX_PROTOCOL_ADS_H__ +#define __CCX_PROTOCOL_ADS_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { +/// \typedef std::map TAdsDeveloperInfo +/// typedef TAdsDeveloperInfo. +typedef std::map TAdsDeveloperInfo; +/// \typedef std::map TAdsInfo +/// typedef TAdsInfo. +typedef std::map 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__ */ diff --git a/ios/include/anysdk/jailbreak/ProtocolAnalytics.h b/ios/include/anysdk/jailbreak/ProtocolAnalytics.h new file mode 100644 index 00000000..ce3372d6 --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolAnalytics.h @@ -0,0 +1,107 @@ +/** @file ProtocolAnalytics.h + */ +#ifndef __CCX_PROTOCOL_ANALYTICS_H__ +#define __CCX_PROTOCOL_ANALYTICS_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { +/// \typedef std::map LogEventParamPair +/// typedef LogEventParamPair. +typedef std::pair< std::string, std::string > LogEventParamPair; +/// \typedef std::map 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,/** +#include + +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__ */ diff --git a/ios/include/anysdk/jailbreak/ProtocolCustom.h b/ios/include/anysdk/jailbreak/ProtocolCustom.h new file mode 100644 index 00000000..dc92558e --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolCustom.h @@ -0,0 +1,50 @@ +/** @file ProtocolCustom.h + */ +#ifndef __CCX_PROTOCOL_CUSTOM_H__ +#define __CCX_PROTOCOL_CUSTOM_H__ + +#include "PluginProtocol.h" +#include +#include + +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__ ----- */ diff --git a/ios/include/anysdk/jailbreak/ProtocolPush.h b/ios/include/anysdk/jailbreak/ProtocolPush.h new file mode 100644 index 00000000..e9e2fac8 --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolPush.h @@ -0,0 +1,104 @@ +/** @file PluginFactory.h + */ +#ifndef __CCX_PROTOCOL_PUSH_H__ +#define __CCX_PROTOCOL_PUSH_H__ + +#include "PluginProtocol.h" +#include +#include +#include +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 tags) = 0; + + /** + *@brief delete tag + *@param tags + *@return void + */ + virtual void delTags(list 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__ */ diff --git a/ios/include/anysdk/jailbreak/ProtocolREC.h b/ios/include/anysdk/jailbreak/ProtocolREC.h new file mode 100644 index 00000000..b0db2c0d --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolREC.h @@ -0,0 +1,83 @@ +/** @file ProtocolREC.h + */ +#ifndef __CCX_PROTOCOL_REC_H__ +#define __CCX_PROTOCOL_REC_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { + +typedef std::map 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__ ----- */ diff --git a/ios/include/anysdk/jailbreak/ProtocolShare.h b/ios/include/anysdk/jailbreak/ProtocolShare.h new file mode 100644 index 00000000..2215a4ff --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolShare.h @@ -0,0 +1,72 @@ +/** @file ProtocolShare.h + */ +#ifndef __CCX_PROTOCOL_SHARE_H__ +#define __CCX_PROTOCOL_SHARE_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { +/// \typedef std::map TShareDeveloperInfo +/// typedef TShareDeveloperInfo. +typedef std::map TShareDeveloperInfo; +/// \typedef std::map TShareInfo +/// typedef TShareInfo. +typedef std::map 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__ ----- */ diff --git a/ios/include/anysdk/jailbreak/ProtocolSocial.h b/ios/include/anysdk/jailbreak/ProtocolSocial.h new file mode 100644 index 00000000..3fa5639b --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolSocial.h @@ -0,0 +1,105 @@ +/** @file ProtocolSocial.h + */ +#ifndef __CCX_PROTOCOL_SOCIAL_H__ +#define __CCX_PROTOCOL_SOCIAL_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { +/// \typedef std::map TSocialDeveloperInfo +/// typedef TSocialDeveloperInfo. +typedef std::map TSocialDeveloperInfo; +/// \typedef std::map TAchievementInfo +/// typedef TAchievementInfo. +typedef std::map 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__ ----- */ diff --git a/ios/include/anysdk/jailbreak/ProtocolUser.h b/ios/include/anysdk/jailbreak/ProtocolUser.h new file mode 100644 index 00000000..387fb9e8 --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolUser.h @@ -0,0 +1,135 @@ +/** @file ProtocolUser.h + */ +#ifndef __CCX_PROTOCOL_USER_H__ +#define __CCX_PROTOCOL_USER_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { +/// \typedef std::map TUserDeveloperInfo +/// typedef TUserDeveloperInfo. +typedef std::map 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 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__ */ diff --git a/ios/include/anysdk/jailbreak/ProtocolYAP.h b/ios/include/anysdk/jailbreak/ProtocolYAP.h new file mode 100644 index 00000000..76706e28 --- /dev/null +++ b/ios/include/anysdk/jailbreak/ProtocolYAP.h @@ -0,0 +1,119 @@ +/** @file ProtocolYAP.h + */ +#ifndef __CCX_PROTOCOL_YAP_H__ +#define __CCX_PROTOCOL_YAP_H__ + +#include "PluginProtocol.h" +#include +#include + +namespace anysdk { namespace framework { +/// \typedef std::map TYAPDeveloperInfo +/// typedef TYAPDeveloperInfo. +typedef std::map TYAPDeveloperInfo; +/// \typedef std::map TProductInfo +/// typedef TProductInfo. +typedef std::map TProductInfo; +/// typedef TProductsInfo. +typedef std::map 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__ */ diff --git a/ios/include/anysdk/jailbreak/PushWrapper.h b/ios/include/anysdk/jailbreak/PushWrapper.h new file mode 100644 index 00000000..f2d53fe2 --- /dev/null +++ b/ios/include/anysdk/jailbreak/PushWrapper.h @@ -0,0 +1,28 @@ +// +// PushWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-10-9. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import + +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 diff --git a/ios/include/anysdk/jailbreak/RECWrapper.h b/ios/include/anysdk/jailbreak/RECWrapper.h new file mode 100644 index 00000000..f6243a05 --- /dev/null +++ b/ios/include/anysdk/jailbreak/RECWrapper.h @@ -0,0 +1,34 @@ +// +// RECWrapper.h +// PluginProtocol +// + + +#import +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 diff --git a/ios/include/anysdk/jailbreak/SdkHttpListener.h b/ios/include/anysdk/jailbreak/SdkHttpListener.h new file mode 100644 index 00000000..43945413 --- /dev/null +++ b/ios/include/anysdk/jailbreak/SdkHttpListener.h @@ -0,0 +1,26 @@ +// +// SdkHttpListener.h +// PluginProtocol +// +// Created by cocos2dx on 14-9-9. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import + +//@protocol +@protocol SdkHttpListener + +/** + * network response + * + * @param response the response message + */ +- (void) onResponse:(NSString*)response; + +/** + * network return error + */ +- (void) onError; + +@end diff --git a/ios/include/anysdk/jailbreak/ShareWrapper.h b/ios/include/anysdk/jailbreak/ShareWrapper.h new file mode 100644 index 00000000..00009774 --- /dev/null +++ b/ios/include/anysdk/jailbreak/ShareWrapper.h @@ -0,0 +1,31 @@ +// +// ShareWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-11-12. +// Copyright (c) 2014年 zhangbin. All rights reserved. +// + +#import + +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 diff --git a/ios/include/anysdk/jailbreak/SocialWrapper.h b/ios/include/anysdk/jailbreak/SocialWrapper.h new file mode 100644 index 00000000..1eb2ea84 --- /dev/null +++ b/ios/include/anysdk/jailbreak/SocialWrapper.h @@ -0,0 +1,38 @@ +// +// SocialWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-10-9. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import + +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 diff --git a/ios/include/anysdk/jailbreak/UserWrapper.h b/ios/include/anysdk/jailbreak/UserWrapper.h new file mode 100644 index 00000000..a31f9f81 --- /dev/null +++ b/ios/include/anysdk/jailbreak/UserWrapper.h @@ -0,0 +1,68 @@ +// +// UserWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-9-4. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import +#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 + diff --git a/ios/include/anysdk/jailbreak/Wrapper.h b/ios/include/anysdk/jailbreak/Wrapper.h new file mode 100644 index 00000000..cc4d410b --- /dev/null +++ b/ios/include/anysdk/jailbreak/Wrapper.h @@ -0,0 +1,110 @@ +// +// Wrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-8-29. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import +#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)getCocosRuntimeSDKProxy; + ++ (void)setCocosRuntimeSDKProxy:(id)runtimeProxy; + ++ (int)getCocosRuntimeSDKVersionCode; + ++ (void)setCocosRuntimeSDKVersionCode:(int)sdkVersionCode; + + +@end diff --git a/ios/include/anysdk/jailbreak/YAPWrapper.h b/ios/include/anysdk/jailbreak/YAPWrapper.h new file mode 100644 index 00000000..b4136d72 --- /dev/null +++ b/ios/include/anysdk/jailbreak/YAPWrapper.h @@ -0,0 +1,86 @@ +// +// YAPWrapper.h +// PluginProtocol +// +// Created by cocos2dx on 14-9-9. +// Copyright (c) 2014年 cocos2dx. All rights reserved. +// + +#import +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 diff --git a/ios/libs/libPluginProtocol.a b/ios/libs/anysdk/common/libPluginProtocol.a similarity index 100% rename from ios/libs/libPluginProtocol.a rename to ios/libs/anysdk/common/libPluginProtocol.a diff --git a/ios/libs/anysdk/jailbreak/libPluginProtocol.a b/ios/libs/anysdk/jailbreak/libPluginProtocol.a new file mode 100644 index 00000000..9d82431a Binary files /dev/null and b/ios/libs/anysdk/jailbreak/libPluginProtocol.a differ