flutter_nimsdk 1.1.7

  • Readme
  • Changelog
  • Example
  • Installing
  • new50

flutter_nimsdk #

pub package

用于Flutter的网易云信SDK

已完成功能 #

音视频 #

  • 初始化
  • 登录
  • 自动登录
  • 登陆状态回调
  • 登出
  • 主动发起通话请求
  • 接收到通话请求
  • 被叫响应通话请求
  • 主叫收到被叫响应回调
  • 通话建立结果回调
  • 挂断
  • 收到对方结束通话回调
  • 通话断开
  • 获取话单
  • 清空本地话单
  • 动态设置摄像头开关
  • 动态切换前后摄像头
  • 设置静音

IM #

  • 最近会话列表
  • 所有最近会话
  • 文本消息
  • 提示消息
  • 图片消息
  • 视频消息
  • 音频消息
  • 文件消息
  • 位置消息
  • 开始录音
  • 结束录音
  • 取消录音

部分示例 #

初始化 #

使用前,先进行初始化:


SDKOptions sdkOptions = SDKOptions(appKey: appkey);
await FlutterNimsdk().initSDK(sdkOptions);

登录 #

LoginInfo loginInfo = LoginInfo(account: "",token: "");
FlutterNimsdk().login(loginInfo).then((result) {
   print(result);
});

退出登录 #

await FlutterNimsdk().logout();

回调 #


//数据接收
  void _onEvent(Object value) {
    print(value);

    /**
     * delegateType 的值对应的回调
     * 
     * 
     * NIMDelegateTypeOnLogin = 0,
     * NIMDelegateTypeOnReceive = 1,
     * NIMDelegateTypeOnResponse = 2,
     * NIMDelegateTypeOnCallEstablished = 3,
     * NIMDelegateTypeOnHangup = 4,
     * NIMDelegateTypeOnCallDisconnected = 5,
     * NIMDelegateTypeDidAddRecentSession = 6,
     * NIMDelegateTypeDidUpdateRecentSession = 7,
     * NIMDelegateTypeDidRemoveRecentSession = 8,
     * NIMDelegateTypeRecordAudioComplete = 9,
     */

  }
  

以上是插件中用到的回调,具体请参照网易云信文档回调接口名称一一对应。例如:

NIMDelegateTypeOnLogin表示的是登陆状态回调:

- (void)onLogin:(NIMLoginStep)step{

}

根据delegateType来区分各种回调。

1.1.7 #

  • 修复挂断不成功问题

1.1.6 #

  • 修复接听不成功的问题

1.1.5 #

  • 修复扩展消息接收不到的问题

1.1.4 #

  • 修复回调问题

1.1.3 #

  • 修复来电信息响应监听的问题

1.1.2 #

  • 修复登陆状态返回值的问题

1.1.1 #

  • Fix bugs

1.1.0 #

  • 添加会话列表头像信息
  • 优化返回信息格式

1.0.0 #

  • change description
  • Fix bugs

0.0.5 #

  • Fix bugs.
  • 优化返回值
  • 回调信息优化

0.0.4 #

  • 增加 IM.

0.0.3 #

  • Fix bugs.

0.0.2 #

  • Fix bugs.

0.0.1 #

  • Initial release.

example/README.md

flutter_nimsdk_example #

Demonstrates how to use the flutter_nimsdk plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_nimsdk: ^1.1.7

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_nimsdk/flutter_nimsdk.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Nov 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/flutter_nimsdk.dart. (-1 points)

Analysis of lib/flutter_nimsdk.dart reported 2 hints:

line 9 col 8: Unused import: 'src/nim_session_model.dart'.

line 20 col 24: Cancel instances of dart.async.StreamSubscription.

Format lib/src/config.dart.

Run flutter format to format lib/src/config.dart.

Format lib/src/config.g.dart.

Run flutter format to format lib/src/config.g.dart.

Fix additional 3 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/enum.dart (Run flutter format to format lib/src/enum.dart.)
  • lib/src/nim_message_model.dart (Run flutter format to format lib/src/nim_message_model.dart.)
  • lib/src/nim_session_model.dart (Run flutter format to format lib/src/nim_session_model.dart.)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
json_annotation ^3.0.0 3.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test