tencent_tpns_xiaomi_push_plugin 0.0.1 icon indicating copy to clipboard operation
tencent_tpns_xiaomi_push_plugin: ^0.0.1 copied to clipboard

PlatformAndroid

小米推送

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:tencent_tpns_xiaomi_push_plugin/tencent_tpns_xiaomi_push_plugin.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';

  @override
  void initState() {
    super.initState();
    test();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> test() async {
    TencentTpnsXiaomiPushPlugin.registerPush(
      appID: "2882303761518516314",
      appToken: "2882303761518516314",
    );
    String regId = await TencentTpnsXiaomiPushPlugin.getRegId();
    //上传给服务端
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_platformVersion\n'),
        ),
      ),
    );
  }
}
0
likes
100
pub points
0%
popularity

Publisher

unverified uploader

小米推送

Homepage

Documentation

API reference

License

Icon for licenses.unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on tencent_tpns_xiaomi_push_plugin