47 lines
902 B
Dart
47 lines
902 B
Dart
//<com>
|
|
import 'firebase/firebase_helper.dart';
|
|
|
|
//</com>
|
|
//<cn>
|
|
import 'umeng/umeng_helper.dart';
|
|
//</cn>
|
|
|
|
class ApmHelper {
|
|
ApmHelper._internal();
|
|
|
|
factory ApmHelper() => _getInstance();
|
|
|
|
static ApmHelper get instance => _getInstance();
|
|
static ApmHelper? _instance;
|
|
|
|
// 增加开关
|
|
static bool enabled = false;
|
|
|
|
static ApmHelper _getInstance() {
|
|
_instance ??= ApmHelper._internal();
|
|
return _instance!;
|
|
}
|
|
|
|
Future<void> initSdk() async {
|
|
//<cn>
|
|
UmengHelper.instance.initSdk();
|
|
//</cn>
|
|
//<com>
|
|
FirebaseHelper.instance.initSdk();
|
|
//</com>
|
|
}
|
|
|
|
Future<void> trackEvent(String eventName,
|
|
{String? title,
|
|
String? screenName,
|
|
String? elementContent,
|
|
String? operation}) async {
|
|
//<cn>
|
|
UmengHelper.instance.trackEvent(eventName);
|
|
//</cn>
|
|
//<com>
|
|
FirebaseHelper.instance.trackEvent(eventName);
|
|
//</com>
|
|
}
|
|
}
|