flutter_nim 0.1.7
flutter_nim: ^0.1.7 copied to clipboard

A new Flutter plugin for netease im, can be used to receive and send messages.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_nim/flutter_nim.dart';
import 'package:flutter_nim_example/utils/user_utils.dart';
import 'package:flutter_nim_example/ui/page_login.dart';
import 'package:flutter_nim_example/ui/page_recent_sessions.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final imAccount = await UserUtils.imAccount;
  final imToken = await UserUtils.imToken;

  FlutterNIM().init(
    appKey: "45c6af3c98409b18a84451215d0bdd6e",
    apnsCername: "ENTERPRISE",
    apnsCernameDevelop: "DEVELOPER",
    imAccount: imAccount,
    imToken: imToken,
  );

  bool isLogin = await UserUtils.isLogin();

  if (isLogin) {
    runApp(MyApp());
  } else {
    runApp(LoginHomePage());
  }
}
4
likes
100
pub points
30%
popularity

A new Flutter plugin for netease im, can be used to receive and send messages.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

icodd.cn@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_nim