• libgdx robovm友盟游戏统计分析SDK的绑定


    为了支持libgdx游戏引擎的推广,本人会定期编写IOS SDK绑定,并且分享给大家.

    用法:

    1.在robovm.xml里面配置你的.a路径(自己在data目录下创建一个libs目录,放入,a)

    <libs>
          <lib>z</lib>   
           <lib>data/libs/libMobClickGameLibrary.a</lib>   
      </libs>

    2.由于使用的全局变量,所以要现在xml里面定义一下才行

    exportedSymbols

    代码:

    <libs>
          <lib>z</lib>   
           <lib>data/libs/libMobClickGameLibrary.a</lib>   
      </libs>
      <frameworks>
        <framework>UIKit</framework>
        <framework>OpenGLES</framework>
        <framework>QuartzCore</framework>
        <framework>CoreGraphics</framework>
        <framework>OpenAL</framework>
        <framework>AudioToolbox</framework>
        <framework>AVFoundation</framework>
      </frameworks>
      <exportedSymbols>
    		<symbol>MobClickSocialType*</symbol>
      </exportedSymbols>
    </config>


    3.使用方法(只测试了部分)

    @Override
    	public boolean didFinishLaunching(UIApplication application,
    			UIApplicationLaunchOptions launchOptions) {
    
    		MobClick.startWithAppkey("your key",
    				ReportPolicy.BATCH, "ios");
    
    		MobClickGameAnalytics.pay(100, 1, 200);
    		MobClickGameAnalytics.buy("xxoo", 1, 100);
    		MobClickGameAnalytics.use("xxoo", 1, 100);
    
    		MobClickGameAnalytics.startLevel("1");
    		MobClickGameAnalytics.finishLevel("1");
    		MobClickGameAnalytics.failLevel("1");
    
    		final NSDictionary<NSString, NSString> dic = new NSDictionary<NSString, NSString>();
    		dic.setAssociatedObject(new NSString("1"), new NSString("1"));
    		dic.setAssociatedObject(new NSString("2"), new NSString("2"));
    
    		MobClickSocialWeibo weibo = new MobClickSocialWeibo(MobClickSocialWeibo.MobClickSocialTypeSina(),
    				"xxxxxxxooooo", "12345", dic);
    		List<MobClickSocialWeibo> weibos = new ArrayList<MobClickSocialWeibo>();
    		weibos.add(weibo);
    
    		MobClickSocialAnalytics.postWeiboCounts(weibos,
    				"your key", "测试", null);
    
    		return super.didFinishLaunching(application, launchOptions);
    	}

    只测试了一部分代码,其余的还没有测试过, 请自行测试. 按照友盟文档来就行了.有不会的地方请留言

    下载地址:https://github.com/tianqiujie/robovm-ios-bindings

  • 相关阅读:
    Apache Airavata 0.6 发布
    Erebus 0.5 发布,2D 实时角色扮演游戏
    Pcompress 1.3.0 发布,性能大幅提升
    JasperStarter 1.0.1 发布
    Newscoop 4.1 发布,适合记者的 CMS 系统
    Wireshark 1.8.5 发布,网络协议检测程序
    Open Search Server 1.4 Beta2 发布
    Erlang/OTP R16A 发布
    Apache Derby 10.8.3.0 发布
    reading notes for solr source code
  • 原文地址:https://www.cnblogs.com/tqj-zyy/p/4559743.html
Copyright © 2020-2023  润新知