英文:
iOS phone, notifications in background it's not vibrate?
问题
我开发Flutter项目并使用FCM和本地通知,在iOS手机处于后台时无法振动。
我的BackgroundHandler:
@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
await setupFlutterNotifications();
showFlutterNotification(message);
}
我使用以下代码进行振动:
await Vibration.vibrate(duration: 500);
英文:
I develop flutter project and I use FCM and Local Notification I have issues when iOS phone in background it's not vibrate.
my BackgroundHandler:
@pragma('vm:entry-point')
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
await setupFlutterNotifications();
showFlutterNotification(message);
}
I use
await Vibration.vibrate(duration: 500);
to vibration.your text
答案1
得分: 1
根据我的观点,你不能这样做,因为通知的振动取决于手机设置,所以即使在手机设置中强制禁用通知振动,你也无法这样做。
更多详情,请查看这个链接,可能会有帮助。
英文:
In my opine you can't because notification vibrate is depends on phone settings so you can't do that even forcefully if notification vibration disable from phone settings.
for more details check this link it may helpful.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论