ソースを参照

1、Bugly添加

tags/0.0.17+1^0
PH2 3年前
コミット
0cd39a74f7
3個のファイルの変更51行の追加3行の削除
  1. +30
    -3
      lib/models/app_config_model.dart
  2. +14
    -0
      lib/register.dart
  3. +7
    -0
      pubspec.yaml

+ 30
- 3
lib/models/app_config_model.dart ファイルの表示

@@ -76,9 +76,10 @@ class AppConfigKeyModel {
AppConfigKeyItemModel jdIos;
AppConfigKeyItemModel jdAndroid;
AppConfigKeyItemModel taobao;
AppConfigKeyItemModel bugly;
GDModel gd;

AppConfigKeyModel({this.weibo, this.qq, this.weixin, this.jdIos, this.jdAndroid,this.taobao});
AppConfigKeyModel({this.weibo, this.qq, this.weixin, this.jdIos, this.jdAndroid, this.taobao, this.bugly});

AppConfigKeyModel.fromJson(Map<String, dynamic> json) {
weibo = json['weibo'] != null ? new AppConfigKeyItemModel.fromJson(json['weibo']) : null;
@@ -88,6 +89,7 @@ class AppConfigKeyModel {
jdAndroid = json['jd_android'] != null ? new AppConfigKeyItemModel.fromJson(json['jd_android']) : null;
taobao = json['taobao'] != null ? new AppConfigKeyItemModel.fromJson(json['taobao']) : null;
gd = json['gd'] != null ? GDModel.fromJson(json['gd']) : null;
bugly = json['bugly_list'] != null ? new AppConfigKeyItemModel.fromJson(json['bugly_list']) : null;
}

Map<String, dynamic> toJson() {
@@ -113,6 +115,9 @@ class AppConfigKeyModel {
if (this.gd != null) {
data['gd'] = this.gd.toJson();
}
if (this.bugly != null) {
data['bugly_list'] = this.bugly.toJson();
}

return data;
}
@@ -189,8 +194,22 @@ class AppConfigKeyItemModel {
String universalLink;
String androidKey;
String iosKey;

AppConfigKeyItemModel({this.appkey, this.secret, this.redirectUrl,this.androidKey,this.iosKey});
String androidAppId;
String androidAppKey;
String iosAppId;
String iosAppKey;

AppConfigKeyItemModel({
this.appkey,
this.secret,
this.redirectUrl,
this.androidKey,
this.iosKey,
this.androidAppId,
this.androidAppKey,
this.iosAppId,
this.iosAppKey
});

AppConfigKeyItemModel.fromJson(Map<String, dynamic> json) {
appId = json['app_id'];
@@ -200,6 +219,10 @@ class AppConfigKeyItemModel {
iosKey = json['ios_key'];
redirectUrl = json['redirect_url'];
universalLink = json['universal_link'];
androidAppId = json['android_appid'];
androidAppKey = json['android_appkey'];
iosAppId = json['ios_appid'];
iosAppKey = json['ios_appkey'];
}

Map<String, dynamic> toJson() {
@@ -211,6 +234,10 @@ class AppConfigKeyItemModel {
data['android_key'] = this.androidKey;
data['ios_key'] = this.iosKey;
data['universal_link'] = this.universalLink;
data['android_appid'] = this.androidAppId;
data['android_appkey'] = this.androidAppKey;
data['ios_appid'] = this.iosAppId;
data['ios_appkey'] = this.iosAppKey;
return data;
}
}


+ 14
- 0
lib/register.dart ファイルの表示

@@ -104,6 +104,8 @@ import 'package:zhiying_comm/util/mob_util/mob_util.dart';
import 'package:zhiying_comm/util/taobao/taobao_auth.dart';
import 'package:package_info/package_info.dart';
import 'package:flutter_alibc/flutter_alibc.dart';
import 'package:flutter_bugly/flutter_bugly.dart';


class BaseWidgetRegister {
/// 初始化方法
@@ -173,6 +175,18 @@ class BaseWidgetRegister {
FlutterAlibc.initAlibc(version: "", appName: "").then((result) async {
Logger.debug('初始化百川sdk ${result.errorCode} ${result.errorMessage}');
});

// bugly初始化 4a25b7aff3 3ff389c35d
if (!EmptyUtil.isEmpty(config?.keys?.bugly)) {
if (Platform.isAndroid && !EmptyUtil.isEmpty(config?.keys?.bugly?.androidAppId)) {
Logger.log('Bugly Android 初始化 = ' + config?.keys?.bugly?.toJson()?.toString());
FlutterBugly.init(androidAppId: config?.keys?.bugly?.androidAppId, iOSAppId: config?.keys?.bugly?.iosAppId, autoCheckUpgrade: false);
} else if (Platform.isIOS && !EmptyUtil.isEmpty(config?.keys?.bugly?.iosAppId)) {
Logger.log('Bugly IOS 初始化 = ' + config?.keys?.bugly?.toJson()?.toString());
FlutterBugly.init(androidAppId: config?.keys?.bugly?.androidAppId, iOSAppId: config?.keys?.bugly?.iosAppId, autoCheckUpgrade: false);
}
}

});

return null;


+ 7
- 0
pubspec.yaml ファイルの表示

@@ -61,6 +61,13 @@ dependencies:

flutter_user_agent: ^1.2.2

# bug 奔溃收集
flutter_bugly:
git:
ref: 0.0.1
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/flutter_bugly.git
# ath: ../flutter_bugly

zhiying_flutter_webview:
git:
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_webview.git


読み込み中…
キャンセル
保存