| 1234567891011121314151617181920212223242526272829303132 |
- import 'package:flutter/foundation.dart';
- import 'package:flutter/services.dart';
- import 'flutter_umeng_platform_interface.dart';
- /// An implementation of [FlutterUmengPlatform] that uses method channels.
- class MethodChannelFlutterUmeng extends FlutterUmengPlatform {
- /// The method channel used to interact with the native platform.
- @visibleForTesting
- final methodChannel = const MethodChannel('flutter_umeng');
- @override
- Future<void> setPolicyGrantResult(bool granted) async {
- return await methodChannel.invokeMethod('setPolicyGrantResult', {
- "granted": granted,
- });
- }
- @override
- Future<void> initCommon(
- {String? androidAppKey, required String iosAppKey}) async {
- String? appKey;
- if (defaultTargetPlatform == TargetPlatform.android) {
- appKey = androidAppKey;
- } else if (defaultTargetPlatform == TargetPlatform.iOS) {
- appKey = iosAppKey;
- }
- return await methodChannel.invokeMethod('initCommon', {
- "appKey": appKey,
- });
- }
- }
|