import 'package:jpush_flutter/jpush_flutter.dart'; class JPushProvider { final JPush jpush = JPush(); Future initJPush() async { jpush.setup( appKey: "7ff37d174c1a568a89e98dad", channel: "flutter_channel", production: false, debug: true, ); jpush.applyPushAuthority(const NotificationSettingsIOS( sound: true, alert: true, badge: true, )); // // Add event handler // jpush.addEventHandler( // onReceiveNotification: (Map message) { // print("Receive notification: $message"); // }, // onOpenNotification: (Map message) { // print("Open notification: $message"); // }, // onReceiveMessage: (Map message) { // print("Receive message: $message"); // }, // ); } }