| 12345678910111213141516171819 |
- import 'package:jpush_flutter/jpush_flutter.dart';
- import 'package:jpush_flutter/jpush_interface.dart';
- class JpushHelper {
- JpushHelper._();
- static JPushFlutterInterface? jpush;
- static void init() {
- jpush = JPush.newJPush();
- }
- static Future<String> getRegistrationId() {
- if (jpush == null) {
- throw Exception('JPush not initialized');
- }
- return jpush!.getRegistrationID();
- }
- }
|