Vibration not working in background mode (Ionic/capacitor)) - ionic-framework

I am working on a project in which the client needs vibration in background-mode.
The method
vibrator.vibrate()
is working when the screen is on and app is open. But when the screen is off or app is minimized (not killed), the vibration function not working. Anybody know the solution?

Ionic Native Plugin - Vibration doesn't have the vibrate in background mode functionality yet. Please refer to this link for the open issue in Github.

Ok I got how to get the background mode vibration in ionic app. Its possible using capacitor haptics vibration and foreground service plugins.
import {Haptics} from "#capacitor/haptics";
import { ForegroundService } from '#ionic-native/foreground-service/ngx';
...
constructor(private fg_service:ForegroundService){}
...
this.fg_service.start('App name', 'Service name', 'drawable/fsicon');
Haptics.vibrate({duration:500});

Related

play loop ringtone in background -Flutter iOS-

I want the audio service to play a custom ringtone that loops when I get a notification on iOS or Android. The sound worked flawlessly in both the background and foreground on Android, as well as in the foreground but not in the background on iOS.
I activated the background mode in iOS (background sound, fetch background notifications).
i tried using the plugins such as : audio_service , audio_manager( audio manager shows audio bar in notification drawer - i want to hide that audio bar - ).
So, any ideas or solutions for this problem?
thanks.

Flutter Just Audio background Package

When play any song then close the app with background playing after that start the app then recent playing song activity show, this good but i wanna that when start the app then app reload, how's possible?
Just audio dont work in background use this just audio background or audio_service is too much advanced or audio player ;
dont forget to add background mode in Xcode :
Hope it work for you ; Good luck

Keep video playing when app goes to the background and show player controller in the notification

Want this feature in flutter (android/IOS)
I want to keep the video playing when an app goes to the background and shows a player controller in the notification.
Is this possible?
You can try this library https://pub.dev/packages/just_audio with the latest version 0.9.21. It's quite easy to configure though some features are still experimental e.g Simultaneous downloading+caching, Background play which are here Experimental features. Overall it works for me.

Is that possible to play default notification sound of a device in flutter?

Is that possible to play default notification sound of a device (for both android and ios) in flutter?
I tried SystemSound.play(SystemSoundType.click);, it doesn't do anything. thanks.
You can use the flutter_ringtone_player plugin to play the default notification sound for both Android and iOS platforms as follows:
FlutterRingtonePlayer.playNotification();

Is it possible to set a custom notification sound instead of default with cordova-plugin-geofence

My requirement is to set a custom notification alert tone in ionic 3 but the plugin documentation does not provide sound parameter in notification object while Localnotification plugin provies.
I have tried to do it using audio plugin inside onTransitionReceived() method.Now the audio is playing while app is in foreground but not working while the app is in background?
Is there any solution to do it??