Flutter 插件集成指南

Flutter 插件集成

pubspec.yaml ⽂件中添加 bonree_flutter_plugin 插件,⽀持本地依赖和远程依赖(选其一种即可)

1、添加依赖

本地依赖:

打开 pubspec.yaml,在 dependencies 下添加 bonree_flutter_plugin:,并指定本地路径,如:

dependencies:
  bonree_flutter_plugin:
    path: ./bonree_flutter_plugin #写bonree_flutter_plugin包的本地路径

远程依赖:

打开 pubspec.yaml,在 dependencies 下添加 bonree_flutter_plugin:,如下:

dependencies:
  bonree_flutter_plugin:

如有必要,可依实际需要添加版本约束,如:

dependencies:
  bonree_flutter_plugin: ^3.0.0

2、执⾏ flutter packages get 命令

3、iOS 在⼯程ios⽬录下执⾏: pod install

4、引包 替换 runApp()

import 'package:bonree_flutter_plugin/bonree_flutter_plugin.dart';

void main() {
    // runApp(MyApp());// 注释原有的 runApp() ⽅法
    Bonree().start(MyApp());
}

运⾏过程中 flutter 显示如下⽇志标明嵌码成功。

[INFO][BONREE]: bonree_flutter_plugin start success

BonreeSDK 接入

参见帮助中心Android-NativeiOS-Native的接入部分。

results matching ""

    No results matching ""