# Native対応
# iOS Native 対応
# 1.1 iOSプロジェクト作成
- iOSプロジェクト新規作成
HBuilderX
-Publish
-Generate
をクリック- ローカルのパッケージ化されたアプリ リソースをプロジェクト カテゴリにコピー
Pandora -> apps
# 1.2 iOSプロジェクト設定
- iOSプロジェクトに依頼ファイルを追加
CocoaPodsを利用してSDKインストール
Podfileを作成&修正
Podfileを作成し、同じカテゴリのプロジェクト(.xcodeproj
)にコードを実行:
pod init
Podfileを編集:
pod 'TAGameEngine'
コード実行:
pod install
# Android Native 対応
# 1.1 构建Android项目
- Androidプロジェクトを作成
HBuilderX
-Publish
-Generate
をクリック- appソースをassets->appsの元にコピー
# 2.2 Android プロジェクト設定
Project
レベルのbuild.gradle
に以下の依頼コードを追加
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
Module
プロジェクトの元にbuild.gradle
ファイルに以下の依頼コードを追加
implementation 'cn.thinkingdata.android:TAGameEngine:1.0.0'
implementation 'cn.thinkingdata.android:ThinkingAnalyticsSDK:2.8.3'
# Native 対応
SDK の初期設定の時に、config
にenableNative: true
を追加し、Native対応できます。
var config = {
appId: "YOUR_APPID",
serverUrl: "YOUR_SERVER_URL",
enableNative: true, // enable native support
autoTrack: {
appLaunch: true, // auto-tracking ta_mp_launch
appShow: true, // auto-tracking ta_mp_show
appHide: true, // auto-tracking ta_mp_hide
pageShow: true, // auto-tracking ta_mp_view
pageShare: true, // auto-tracking ta_mp_share
appInstall:true,// auto-tracking ta_app_install(only for native)
appCrash: true, // auto-tracking ta_app_crash(only for native)
}
};
// create TA instance
var ta = new ThinkingAnalyticsAPI(config);
// init
ta.init();
ta.track("test_event");