Push notification overview
The Flutter SDK wraps push parameter configuration APIs. Push notification functionality relies on the native Android and iOS push capabilities.
Integrate push
Refer to the native platform push documentation:
Configure Android push providers
Dart
class PushOptions {
String? idMI;
String? appKeyMI;
String? appIdMeizu;
String? appKeyMeizu;
String? appKeyOPPO;
String? appSecretOPPO;
bool? enableHWPush;
bool? enableFCM;
bool? enableVIVOPush;
}
Code example
Dart
await NCEngine.initialize(InitParams(
appKey: '<your-app-key>',
pushOptions: PushOptions(
idMI: AndroidPushInfo.idMI,
appKeyMI: AndroidPushInfo.appKeyMI,
appIdMeizu: AndroidPushInfo.appIdMeizu,
appKeyMeizu: AndroidPushInfo.appKeyMeizu,
appKeyOPPO: AndroidPushInfo.appKeyOPPO,
appSecretOPPO: AndroidPushInfo.appSecretOPPO,
enableHWPush: true,
enableFCM: false,
enableVIVOPush: true,
),
));
tip
In addition to the above API, native-layer configuration is required for Android push providers. See Android Push.
iOS push
Prerequisites
See iOS Push.
Request push permission
Request notification authorization in AppDelegate. Register for remote notifications to obtain the device token.
Set the device token
The Flutter SDK internally calls the native iOS SDK setDeviceToken method. No manual call is needed.