Move registerReceiver to no avail

This commit is contained in:
Brandon Presley 2022-10-28 17:31:10 +13:00
parent 1c58dc2db1
commit 5441aa164b
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,6 @@ class AlarmModule constructor(context: ReactApplicationContext?) :
@ReactMethod
fun timer(milliseconds: Int, vibrate: Boolean, sound: String?, noSound: Boolean = false) {
Log.d("AlarmModule", "Queue alarm for $milliseconds delay")
reactApplicationContext.registerReceiver(receiver, IntentFilter(STOP_BROADCAST))
val manager = getManager()
manager.cancel(NOTIFICATION_ID_DONE)
reactApplicationContext.stopService(
@ -161,6 +160,7 @@ class AlarmModule constructor(context: ReactApplicationContext?) :
val contentIntent = Intent(context, MainActivity::class.java)
val pendingContent =
PendingIntent.getActivity(context, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)
reactApplicationContext.registerReceiver(receiver, IntentFilter(STOP_BROADCAST))
val stopIntent = Intent(STOP_BROADCAST)
stopIntent.flags =Intent.FLAG_ACTIVITY_NEW_TASK
val pendingStop =