import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'atmob_channel_reader_platform_interface.dart'; /// An implementation of [AtmobChannelReaderPlatform] that uses method channels. class MethodChannelAtmobChannelReader extends AtmobChannelReaderPlatform { /// The method channel used to interact with the native platform. @visibleForTesting final methodChannel = const MethodChannel('atmob_channel_reader'); @override Future default4Test(String channel, int tgPlatformId, int appId) async { if (Platform.isAndroid) { await methodChannel.invokeMethod('default4Test', { 'channel': channel, 'tgPlatformId': tgPlatformId, 'appId': appId, }); } } @override Future getChannel() async { if (Platform.isAndroid) { return await methodChannel.invokeMethod('getChannel'); } if (Platform.isIOS) { return 'AppStore'; } return null; } @override Future getTgPlatformId() async { if (Platform.isAndroid) { return methodChannel.invokeMethod('getTgPlatformId'); } return 0; } @override Future getAppId() async { if (Platform.isAndroid) { return methodChannel.invokeMethod('getAppId'); } return 0; } }