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 getRegistrationId() { if (jpush == null) { throw Exception('JPush not initialized'); } return jpush!.getRegistrationID(); } }