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 appKey) async {
    return await methodChannel.invokeMethod('initCommon', {
      "appKey": appKey,
    });
  }
}
