Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jpush/janalytics-unity3d-plugin

Repository files navigation

JAnalytics Unity Plugin

release platforms

极光官方支持的 JAnalytics Unity 插件(Android & iOS)。

集成

把Plugins文件夹里的文件合并到您自己的项目Assets/Plugins文件夹下面

Android

  1. 替换 AndroidManifest.xml 里的包名。
  2. 将 AndroidManifest.xml 中的 JPUSH_APPKEY 值替换成极光控制台应用详情中的 AppKey 值。
  3. 配置项目里的包名:在 Unity 中选择 File---Build Settings---Player Settings,将 Identification 选项下的 Bundle Identifier 设置为应用的包名。

iOS

  1. 生成 iOS 工程,并打开该工程。

  2. 添加必要的框架:

    • UIKit
    • SystemConfiguration
    • CoreTelephony
    • CoreGraphics
    • Security
    • Foundation
    • CoreLocation
    • CoreFoundation
    • CFNetwork
    • libz.tbd
    • libresolv.tbd
    • libsqlite3.tbd(v2.0.0及以上版本需要)
  3. 在 UnityAppController.mm 中添加头文件 JANALYTICSService.h

    #import "JANALYTICSService.h"
    
  4. 在 UnityAppController.mm 的下列方法中添加以下代码:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     
     /*
     参数说明:
     appKey: 极光官网控制台应用标识。
     channel: 频道,暂无可填任意。
     */
     JANALYTICSLaunchConfig * config = [[JANALYTICSLaunchConfig alloc] init];
     config.appKey = @"替换成你自己的 Appkey";
     config.channel = @"";
     [JANALYTICSService setupWithConfig:config];
     return YES;
    }
    

API 说明

Android 与 iOS 通用 API

Android

Android API

./PluginsAndroidAARCode/janalytics-unity-plugin 为插件的 Android 项目,可以使用 Android Studio 打开并进行修改,再 build 为 .aar 替换已有的 janalytics-unity-plugin-release.aar。

iOS

iOS API

更多

About

极光官方支持的 JAnalytics Unity 插件(Android & iOS)

Resources

Stars

Watchers

Forks

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /