read_native_channel_plugin 0.0.2

Flutter Android

A new flutter plugin project.

read_native_channel_plugin #

A plugin to access native configuration for both Android and iOS from Flutter.

For some third party integrations, for example Google and Facebook, the API keys are usually stored in the native realm -- namely AndroidManifest.xml and Info.plist -- and there's no way to access these values from Flutter. Until now, that it :)

This plugin allows you to access those values directly from Flutter so you don't have to include then in Dart code in addition to the native realm.

Usage #

Import package:flutter_native_config/flutter_native_config.dart, and use the public function FlutterNativeConfig.getConfig() to retrieve a value from both Android and iOS. Because most of the time the key names are different for these two platforms, the function accepts a separate key for each platform.

Example:

import 'package:readNativeChannelPlugin/readNativeChannelPlugin.dart';

static Future<String> get channelName async {
    final String channelName = await _channel.invokeMethod('getChannelName');
    return channelName;
  }

  static Future<String> getConfig({String android, String ios}) {
    if (Platform.isIOS) {
      return FlutterNativeConfig.getConfig(ios: ios,name: ios);
    } else if (Platform.isAndroid) {
      if (android == "channelName") {
        return ReadNativeChannelPlugin.channelName;
      } else {
        return FlutterNativeConfig.getConfig(android: android,name: android);
      }
    }
  }

Issues #

For reporting bugs, incompatibilities, or feature requests, please submit a new issue.

Contributing #

If you wish to contribute a fix or a new feature, please submit a pr.

License #

This plugin is released under the MIT license.

0
likes
60
pub points
9%
popularity

A new flutter plugin project.

Documentation

API reference

Uploader

ivantian37@gmail.com

License

MIT (LICENSE)

Dependencies

flutter, flutter_native_config

More

Packages that depend on read_native_channel_plugin