Add advertisement type for more Ads plugins.

This commit is contained in:
zhangbin 2013-06-18 15:53:56 +08:00
parent 16cab98aa8
commit 7939c3d73f
11 changed files with 43 additions and 4 deletions

1
plugin/.gitignore vendored
View File

@ -94,4 +94,5 @@ tools/toolsForPublish/environment.sh
.settings .settings
plugins/china* plugins/china*
plugins/punchbox* plugins/punchbox*
plugins/touchpay*
samplesPrivate* samplesPrivate*

View File

@ -99,6 +99,9 @@ public class AdsAdmob implements InterfaceAds {
case AdsWrapper.ADS_TYPE_FULL_SCREEN: case AdsWrapper.ADS_TYPE_FULL_SCREEN:
LogD("Now not support full screen view in Admob"); LogD("Now not support full screen view in Admob");
break; break;
case AdsWrapper.ADS_TYPE_MORE_APP:
LogD("Now not support more app ads in Admob");
break;
default: default:
break; break;
} }
@ -106,7 +109,7 @@ public class AdsAdmob implements InterfaceAds {
@Override @Override
public void spendPoints(int points) { public void spendPoints(int points) {
// do nothing, Admob don't have this function LogD("Admob not support spend points!");
} }
@Override @Override
@ -261,4 +264,9 @@ public class AdsAdmob implements InterfaceAds {
public String getPluginVersion() { public String getPluginVersion() {
return "0.2.0"; return "0.2.0";
} }
@Override
public void queryPoints() {
LogD("Admob not support query points!");
}
} }

View File

@ -50,6 +50,7 @@ typedef enum {
- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo; - (void) configDeveloperInfo: (NSMutableDictionary*) devInfo;
- (void) showAds: (int) type size:(int) sizeEnum position:(int) pos; - (void) showAds: (int) type size:(int) sizeEnum position:(int) pos;
- (void) hideAds: (int) type; - (void) hideAds: (int) type;
- (void) queryPoints;
- (void) spendPoints: (int) points; - (void) spendPoints: (int) points;
- (void) setDebugMode: (BOOL) isDebugMode; - (void) setDebugMode: (BOOL) isDebugMode;
- (NSString*) getSDKVersion; - (NSString*) getSDKVersion;

View File

@ -62,10 +62,18 @@
return; return;
} }
if (type == kTypeBanner) { switch (type) {
case kTypeBanner:
[self showBanner:sizeEnum atPos:pos]; [self showBanner:sizeEnum atPos:pos];
} else { break;
case kTypeFullScreen:
OUTPUT_LOG(@"Now not support full screen view in Admob"); OUTPUT_LOG(@"Now not support full screen view in Admob");
break;
case kTypeMoreApp:
OUTPUT_LOG(@"Now not support more app ads in Admob");
break;
default:
break;
} }
} }
@ -82,9 +90,14 @@
} }
} }
- (void) queryPoints
{
OUTPUT_LOG(@"Admob not support query points!");
}
- (void) spendPoints: (int) points - (void) spendPoints: (int) points
{ {
OUTPUT_LOG(@"Admob not support spend points!");
} }
- (void) setDebugMode: (BOOL) isDebugMode - (void) setDebugMode: (BOOL) isDebugMode

View File

@ -72,6 +72,7 @@ public:
typedef enum { typedef enum {
kBannerAd = 0, kBannerAd = 0,
kFullScreenAd, kFullScreenAd,
kMoreApp,
} AdsType; } AdsType;
typedef enum { typedef enum {
@ -111,6 +112,11 @@ public:
*/ */
void hideAds(AdsType type); void hideAds(AdsType type);
/**
@brief Query the points of player
*/
void queryPoints();
/** /**
@brief Spend the points. @brief Spend the points.
Use this method to notify server spend points. Use this method to notify server spend points.

View File

@ -119,6 +119,11 @@ void ProtocolAds::hideAds(AdsType type)
PluginUtils::callJavaFunctionWithName_oneParam(this, "hideAds", "(I)V", type); PluginUtils::callJavaFunctionWithName_oneParam(this, "hideAds", "(I)V", type);
} }
void ProtocolAds::queryPoints()
{
PluginUtils::callJavaFunctionWithName(this, "queryPoints");
}
void ProtocolAds::spendPoints(int points) void ProtocolAds::spendPoints(int points)
{ {
PluginUtils::callJavaFunctionWithName_oneParam(this, "spendPoints", "(I)V", points); PluginUtils::callJavaFunctionWithName_oneParam(this, "spendPoints", "(I)V", points);

View File

@ -41,6 +41,7 @@ typedef enum {
typedef enum { typedef enum {
kTypeBanner = 0, kTypeBanner = 0,
kTypeFullScreen, kTypeFullScreen,
kTypeMoreApp,
} AdsTypeEnum; } AdsTypeEnum;
typedef enum { typedef enum {

View File

@ -29,6 +29,7 @@ THE SOFTWARE.
- (void) configDeveloperInfo: (NSMutableDictionary*) devInfo; - (void) configDeveloperInfo: (NSMutableDictionary*) devInfo;
- (void) showAds: (int) type size:(int) sizeEnum position:(int) pos; - (void) showAds: (int) type size:(int) sizeEnum position:(int) pos;
- (void) hideAds: (int) type; - (void) hideAds: (int) type;
- (void) queryPoints;
- (void) spendPoints: (int) points; - (void) spendPoints: (int) points;
- (void) setDebugMode: (BOOL) debug; - (void) setDebugMode: (BOOL) debug;
- (NSString*) getSDKVersion; - (NSString*) getSDKVersion;

View File

@ -39,6 +39,7 @@ public class AdsWrapper {
public static final int ADS_TYPE_BANNER = 0; public static final int ADS_TYPE_BANNER = 0;
public static final int ADS_TYPE_FULL_SCREEN = 1; public static final int ADS_TYPE_FULL_SCREEN = 1;
public static final int ADS_TYPE_MORE_APP = 2;
public static final int POS_CENTER = 0; public static final int POS_CENTER = 0;
public static final int POS_TOP = 1; public static final int POS_TOP = 1;

View File

@ -32,6 +32,7 @@ public interface InterfaceAds {
public void configDeveloperInfo(Hashtable<String, String> devInfo); public void configDeveloperInfo(Hashtable<String, String> devInfo);
public void showAds(int type, int sizeEnum, int pos); public void showAds(int type, int sizeEnum, int pos);
public void hideAds(int type); public void hideAds(int type);
public void queryPoints();
public void spendPoints(int points); public void spendPoints(int points);
public void setDebugMode(boolean debug); public void setDebugMode(boolean debug);
public String getSDKVersion(); public String getSDKVersion();

View File

@ -34,6 +34,7 @@ const std::string s_aTestCases[] = {
const std::string s_aTestTypes[] = { const std::string s_aTestTypes[] = {
"Banner", "Banner",
"Full Screen", "Full Screen",
"More App",
}; };
const std::string s_aTestPoses[] = { const std::string s_aTestPoses[] = {