runBackgroundEnableWithIOS method
only ios
是否允许SDK 后台运行(默认值:NO) 备注:可以未启动SDK就调用该方法
支持当APP进入后台后,个推是否运行,YES.允许
注意:开启后台运行时,需同时开启Signing & Capabilities > Background Modes > Auido, Airplay and Picture in Picture 才能保持长期后台在线,该功能会和音乐播放冲突,使用时请注意。 本方法有缓存,如果要关闭后台运行,需要调用GeTuiSdk runBackgroundEnable:NO
Implementation
Future<bool> runBackgroundEnableWithIOS(bool enable) async {
if (_isIOS) {
final bool? status =
await _channel.invokeMethod<bool?>('runBackgroundEnable', enable);
return status ?? false;
}
return false;
}