startMiPush method

void startMiPush({
  1. required String appId,
  2. required String appKey,
})

开启小米厂商通道 appId 为在小米平台注册所得Id appKey 为在小米平台注册所得key

Implementation

void startMiPush({required String appId, required String appKey}) async {
  final bool isMIUI = await _channel.invokeMethod('isMiuiRom');
  if (isMIUI) {
    _channel.invokeMethod('setMiPushAppId', {'appId': appId});
    _channel.invokeMethod('setMiPushAppKey', {'appKey': appKey});
    _channel.invokeMethod('enableOtherPush');
    _channel.invokeMethod('regPush');
  }
}