flutter_push_mixin 1.4.0 copy "flutter_push_mixin: ^1.4.0" to clipboard
flutter_push_mixin: ^1.4.0 copied to clipboard

flutter 中国主要平台混合推送(xiaomi、huawei、vivo、oppo、apple)

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_push_mixin/flutter_push_mixin.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {

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

  Future initPushUtil() async {
    FlutterPushMixin.initMixinPushListen(
      onAndroidGetId: (RegIdModel model) {},
      onMessage: (PayloadMessageModel model) {},
      getApnsToken: (String token) {
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: '推送数据获取测试',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
            child: CupertinoButton(
          color: Colors.red,
          onPressed: () {
            initPushUtil();
          },
          child: const Text('获取RegId并复制'),
        )),
      ),
    );
  }
}
0
likes
115
pub points
0%
popularity

Publisher

verified publisherzg2025.cn

flutter 中国主要平台混合推送(xiaomi、huawei、vivo、oppo、apple)

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_apns_only, logger, notification_permissions

More

Packages that depend on flutter_push_mixin