果盟广告SDK
//
// GuomobWallView.h
// GuoMobWallSample
//
// Created by keyrun on 14-1-21.
// Copyright (c) 2014年 AK. All rights reserved.
// #import <Foundation/Foundation.h>
#import "GuoMobWallViewController.h" @interface GuomobWallView : NSObject @end
//
// GuomobWallView.m
// GuoMobWallSample
//
// Created by keyrun on 14-1-21.
// Copyright (c) 2014年 AK. All rights reserved.
// #import "GuomobWallView.h"
#import "GuoMobWallViewController.h"
static GuoMobWallViewController * guomobwall=nil;
@implementation GuomobWallView +(void)InitGuoMobWall:(NSString *)appkey updatetime:(int)updatetime modelname:(NSString *)name{
if (!guomobwall) {
guomobwall=[[GuoMobWallViewController alloc]initWithId:appkey Model:name];
guomobwall.updatetime=updatetime;
}
}
extern "C" void InitGuoMobWall(const char * appkey,int time,const char * ModelName)
{
[GuomobWallView InitGuoMobWall:[NSString stringWithUTF8String:appkey] updatetime:time modelname:[NSString stringWithUTF8String:ModelName]];
}
extern "C" void LoadGuoMobWall(int rotation,int screen)
{
if (guomobwall) {
[guomobwall pushGuoMobWall:rotation Hscreen:screen];
}
}
extern "C" void GuoMobWallSetOtherID(const char * OtherID)
{
if (guomobwall) {
guomobwall.OtherID=[NSString stringWithUTF8String:OtherID];
}
}
extern "C" void GuoMobWallSetStatusBar(int isStatusBarHidden)
{
if (guomobwall) {
guomobwall.isStatusBarHidden=isStatusBarHidden;
}
}
extern "C" int GuoMobWallreadpoint()
{
if (guomobwall) {
int point=[guomobwall readPoint];
return point;
}
return nil;
}
extern "C" void GuoMobWallwritepoint(int point)
{
if (guomobwall) {
[guomobwall writePoint:point];
}
}
extern "C" int GuoMobWallcheckpoint()
{
if (guomobwall) {
int point=[guomobwall checkPoint];
return point;
}
return nil;
}
extern "C" void GuoMobWallupdatepoint()
{
if (guomobwall) {
[guomobwall updatePoint];//更新积分
}
}
extern "C" void ReleaseGuoMobWall()
{
if(guomobwall!=nil)
{
[guomobwall release];
guomobwall=nil;
}
}
- (void)dealloc
{
if(guomobwall!=nil)
{
[guomobwall release];
guomobwall=nil;
}
[super dealloc];
}
@end
//
// GuoMobWall.h
// GuoMobWall
//
// Created by qq on 12-11-21.
// Copyright (c) 2012年 AK. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h> @interface GuoMobWallViewController : UIViewController - (id)initWithId:(NSString *)appKey Model:(NSString*)name;
-(void)pushGuoMobWall:(BOOL)allow Hscreen:(BOOL)isHscreen;
//查询积分
- (int)checkPoint;
//读取所有积分并清空
- (int)readPoint;
//追加积分
- (void)writePoint:(int)writepoint;
//刷新积分
-(void)updatePoint; @property(nonatomic)NSTimeInterval updatetime;//自动刷新积分的时间间隔
@property(nonatomic)BOOL isStatusBarHidden;//积分墙是否显示状态栏
@property(nonatomic,copy) NSString * OtherID;//使用积分服务器回调时候的可选参数
@end
GuoMobWall.cs
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class GuoMobWall : MonoBehaviour { // Use this for initialization
void Start () { } // Update is called once per frame
void Update () { } [DllImport("__Internal")]
private static extern void InitGuoMobWall(string appkey,int updatetime,string ObjectName);
[DllImport("__Internal")]
private static extern void LoadGuoMobWall(int rotation,int screen);
[DllImport("__Internal")]
private static extern void GuoMobWallSetOtherID(string OtherID);
[DllImport("__Internal")]
private static extern void GuoMobWallSetStatusBar(int isStatusBarHidden);
[DllImport("__Internal")]
private static extern int GuoMobWallreadpoint();
[DllImport("__Internal")]
private static extern void GuoMobWallwritepoint(int point);
[DllImport("__Internal")]
private static extern int GuoMobWallcheckpoint();
[DllImport("__Internal")]
private static extern void GuoMobWallupdatepoint();
[DllImport("__Internal")]
private static extern void ReleaseGuoMobWall(); //初始化积分墙 参数: appkey:果盟广告密钥 //updatetime:设置自动刷新积分的时间间隔
//******注:不设置该updatetime参数的话,SDK默认为20秒,自动刷新时间最小值为15******
//******设置updatetime为0为不自动刷新,开发者自己去控制刷新****** //ObjectName: GMWallDelegate.cs脚本绑定的Object名称 比如 Main Camera
public static void U3DInitGuoMobWall(string appkey,int updatetime,string ObjectName)
{ if(Application.platform == RuntimePlatform.IPhonePlayer)
{
InitGuoMobWall(appkey,updatetime,ObjectName);
}
} //加载积分墙 rotation:积分墙是否自适应旋转 1---旋转, 0---不旋转
// screen:积分墙初始横竖屏状态 1---横屏, 0---竖屏
public static void U3DLoadGuoMobWall(int rotation,int screen)
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
LoadGuoMobWall(rotation,screen);
}
}
public static void U3DGuoMobWallSetOtherID(string OtherID)
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
GuoMobWallSetOtherID(OtherID);
}
}
public static void U3DGuoMobWallSetStatusBar(int isStatusBarHidden)
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
GuoMobWallSetStatusBar(isStatusBarHidden);
}
} //读取积分,全部读取积分并且清零,返回整形的积分
public static int U3DGuoMobWallreadpoint()
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
return GuoMobWallreadpoint();
}
return ;
} //添加积分,减分参数请设置为负数
public static void U3DGuoMobWallwritepoint(int point)
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
GuoMobWallwritepoint(point);
}
} //查询积分,不清零,返回整形的积分
public static int U3DGuoMobWallcheckpoint()
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
return GuoMobWallcheckpoint();
}
return ;
} //更新服务器已经完成任务但没有取走的积分
public static void U3DGuoMobWallupdatepoint()
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
GuoMobWallupdatepoint();
}
} //释放积分墙,释放后会停止自动更新积分,释放后再次加载需要重新初始化积分墙
public static void U3DReleaseGuoMobWall()
{
if(Application.platform == RuntimePlatform.IPhonePlayer)
{
ReleaseGuoMobWall();
}
} }
GMWallDelegate.cs
using UnityEngine;
using System.Collections; public class GMWallDelegate : MonoBehaviour { // Use this for initialization
void Start () { } // Update is called once per frame
void Update () { } //加载回调 表示加载成功
void loadWallAdSuccess()
{
print("loadWallAdSuccess");
} //加载积分墙出错时候的回调 返回错误信息
void GMWallDidFailWithError(string error){
print(error);
} //更新积分出错时候的回调 返回错误信息
void GMUpdatePointError(string error){
print(error);
} //点击下载按钮
void onClickDownLoad(){
print("onClickDownLoad");
} //点击返回按钮
void onClickBack(){
print("onClickBack");
} //
//可以只在积分point不为0的情况下提示, 回调格式为:
// 名字,积分 如: 新三国,200 表示用户通过下载新三国得到了200积分
void GMWallGetPoint(string NameAndPoint){
print(NameAndPoint);
}
}
果盟广告SDK的更多相关文章
- cocos2dx-3.1 接入多盟广告sdk+Android (2)
上篇,把基本工作做完了,接下来,在C++下加入代码. 1.打开win32下的project,加入一个类.DomobAd.代码例如以下, <pre name="code" cl ...
- unity, 集成iOS广告sdk注意事项
----更新:2015-10-22 今天在unity里集成讯飞语音听写的iOS sdk,结果发现前面集成domob广告的方法搞复杂了. 其实,直接把UnityViewControllerBase当做s ...
- iOS开发——iOS10升级极光推送SDK、友盟分享SDK
前不久升级了Xcode8 ,同时iOS10系统也推送久. 由于公司需要适配iOS 10系统,同时第三方sdk建议升级. 包含替换升级新的SDK和相应的代码修改. 主要分享如何升级极光推送SDK,友盟分 ...
- UmengAppDemo【友盟统计SDK集成以及多渠道打包配置,基于V7.5.3版本】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 这里只是记录下集成友盟统计SDK以及简单配置多渠道打包的步骤.所以1.该Demo不能运行:2.配置多渠道打包只是一种简单的写法,具体 ...
- UmengShareDemo【友盟分享SDK集成,基于V6.9.3版本】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 这里简单记录下友盟分享SDK集成的步骤. 如果想要使用自定义分享对话框实现,请参考<ShareDialogDemo[分享对话框 ...
- 【Android】接入有米广告SDK
测试:接入有米广告SDK(测试广告). 步骤: 1.注册并登录有米广告. 2.下载相应的SDK,这里我选了第一个[Android广告SDK ],如下图: 3.下好后,根据doc文档步骤进行操作,包括: ...
- 配置友盟最新SDK遇到的问题
编译报错 Undefined symbols for architecture i386:原因:i386是代表模拟器,显示i386错误说明静态库不支持模拟器,只支持真机.友盟最新SDK可能不支持模拟 ...
- WP8 中使用HTML Agility Pack与友盟分享SDK遇到的 System.Xml.XPath加载问题
今晚在尝试使用友盟最新的社交分享SDK时,按照官方Demo,并未做多少多少改动,就是去除了对微信.脸书和推特的分享.然后运行之后就一直报错 : {System.IO.FileLoadException ...
- 适用于 Flutter 的 Google 移动广告 SDK 正式版现已发布
作者 / Zoey Fan,Flutter 产品经理 应用变现有多种方法: 通过实体企业的店面接受付款.提供订阅或应用内购买,或者直接在应用中投放广告.经过六个月的 beta 测试期,我们很高兴能够推 ...
随机推荐
- MYSQL基础01(新增,修改,删除)
首先说明一下,本人之前一直都是用MSSQL,由于工作原因,每天写上百条sql语句,并持续了几年;由于换了工作目前主要接触的MYSQL;所以现在开始学习MYSQL. 我的学习计划很简单,我在MSSQL使 ...
- 济南学习 Day1 T3 pm
[问题描述]小 Q 对计算几何有着浓厚的兴趣.他经常对着平面直角坐标系发呆,思考一些有趣的问题.今天,他想到了一个十分有意思的题目:首先,小 Q 会在x轴正半轴和y轴正半轴分别挑选
- 采用Service实现本地推送通知
在android的应用层中,涉及到很多应用框架,例如:Service框架,Activity管理机制,Broadcast机制,对话框框架,标题栏框架,状态栏框架,通知机制,ActionBar框架等等. ...
- 使用DriverManager获取数据库连接的一个小改进
由于使用DriverManager获取数据库连接时,由于DriverManager实现类中有一段静态代码块,可以直接注册驱动,且可以同时管理多个驱动程序 所以当换数据库连接时需要指定不同的数据库,那么 ...
- js实现checkbox的全选/取消
所有的操作都将使用jquery进行. 主要是为了实现指定内容的批量/单独删除操作. 先看一下页面的设计. 实现操作的主要地方是: 首先实现单击“标题”旁的checkbox实现所有条目的选择. 要点:j ...
- sql server 中 bigint 和 datetime 性能比较
-- 创建表 create table Test_tbl ( ID varchar(40) primary key nonclustered, IntCol int, DateCol datetime ...
- Android布局揭秘
前言 今天把对于布局的一些理解写下来,主要内容包括控件的属性的继承关系,控件与容器的属性的关系,以及各种类的属性的使用. 控件的属性种类 通常意义上讲,我们在对一个控件进行属性赋值的时候大体上有种类型 ...
- node-mongo-native1.3.19连接mongo的最优方法
最近需要在node下连接mongo,尝试了很多方法,本文简要总结一下 选择Driver 首先,基本上有4个常见的driver供选择 1.官方的是node-mongo-native 2.基于node-m ...
- C# 命名参数【转】
命名参数(Named Arguments)就是说在调用函数时可以通过指定参数名称的方式来调用参数.它最大的好处就是方便调用参数时按调用者的需要来排列顺序,而不必死守函数声明时的顺序(相对于“位置参数” ...
- 多实例MySQL批量添加用户和密码并授权
OS:Cent OS 6.3 DB:5.5.14 如果一台服务器上有100个MySQL数据库实例,此时需要给不同端口的几个数据库添加用户名.密码并授权应用IP,一个个授权没问题,反正累的不是我,哇咔咔 ...