Closed singhcreations closed 1 month ago
Hi @singhcreations
What you need is to automatically reschedule the alarms on device reboot ?
default alarm apps didn't effect after device reboot or after switch off then switch on it works again like before but here in this we can't able to get alarm after reboot.
On Mon, 22 Apr, 2024, 2:50 pm Gautier de Lataillade, < @.***> wrote:
Hi @singhcreations https://github.com/singhcreations
What you need is to automatically reschedule the alarms on device reboot ?
— Reply to this email directly, view it on GitHub https://github.com/gdelataillade/alarm/issues/186#issuecomment-2068905526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZUNHLEFCIGLIMX5WW4ZJ3Y6TI7NAVCNFSM6AAAAABGQ2JQLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYHEYDKNJSGY . You are receiving this because you were mentioned.Message ID: @.***>
You can use this package to run dart code on device boot: flutter_boot_receiver. You can call the code which schedules alarms in the callback function. I created this package for this exact issue in my clock app.
This feature has been added to alarm version 4.x.x.
Is this feature really working? The alarm doesn't sound after reboot. My version is 4.0.6.
Please provide your android version.
phone: Galaxy Note 10, android version: 12, phone2: Galaxy S22, android version: 14. In my case, neither device worked.
Did you add this permission in your manifest ?
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
Make sure you followed the installation steps.
I already did that. but in my case, After downloading the package, I changed the version of Flutter shared preferences to 2.2.3 to match my dart version. I confirmed that even if I change the version, it saves well in Flutter. Do you think there's a chance that Kotlin won't be able to retrieve the saved value because of this?
I have no idea. Could be possible. Can't you upgrade your dart version ?
Also, depending on the device performance, alarms can take a couple of minutes to be rescheduled after a device reboot.
I tried many times to upgrade the dart version, but failed. I don't think that's the case for me..
I will try harder first. Thank you for your kind reply!
Good luck !
I found a solution! I created a BootReceiver.kt file next to kotlin mainActivity.kt in my app folder and added this code and it worked.
class BootReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (intent.action == "android.intent.action.BOOT_COMPLETED") {} } }
I think it would be a good idea to notify others as they may experience this same problem.
@jys324 it shouldn't be necessary... the alarm plugin has its own BootReceiver.
please make feature of repetition of alarm daily because your custom daily alarm code is not always workable
On Mon, 21 Oct, 2024, 2:30 am Gautier de Lataillade, < @.***> wrote:
@jys324 https://github.com/jys324 it shouldn't be necessary... the alarm plugin has its own BootReceiver.
— Reply to this email directly, view it on GitHub https://github.com/gdelataillade/alarm/issues/186#issuecomment-2425220149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZUNHLUGGXTC23E47O75Y3Z4QKVNAVCNFSM6AAAAABGQ2JQLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRVGIZDAMJUHE . You are receiving this because you were mentioned.Message ID: @.***>
Alarm plugin latest version
whenever phone is switch off then there is no alarm on alarm time we have to open the alarm app again and again doing the process