Move registerReceiver to no avail
This commit is contained in:
parent
1c58dc2db1
commit
5441aa164b
|
@ -66,7 +66,6 @@ class AlarmModule constructor(context: ReactApplicationContext?) :
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
fun timer(milliseconds: Int, vibrate: Boolean, sound: String?, noSound: Boolean = false) {
|
fun timer(milliseconds: Int, vibrate: Boolean, sound: String?, noSound: Boolean = false) {
|
||||||
Log.d("AlarmModule", "Queue alarm for $milliseconds delay")
|
Log.d("AlarmModule", "Queue alarm for $milliseconds delay")
|
||||||
reactApplicationContext.registerReceiver(receiver, IntentFilter(STOP_BROADCAST))
|
|
||||||
val manager = getManager()
|
val manager = getManager()
|
||||||
manager.cancel(NOTIFICATION_ID_DONE)
|
manager.cancel(NOTIFICATION_ID_DONE)
|
||||||
reactApplicationContext.stopService(
|
reactApplicationContext.stopService(
|
||||||
|
@ -161,6 +160,7 @@ class AlarmModule constructor(context: ReactApplicationContext?) :
|
||||||
val contentIntent = Intent(context, MainActivity::class.java)
|
val contentIntent = Intent(context, MainActivity::class.java)
|
||||||
val pendingContent =
|
val pendingContent =
|
||||||
PendingIntent.getActivity(context, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)
|
PendingIntent.getActivity(context, 0, contentIntent, PendingIntent.FLAG_IMMUTABLE)
|
||||||
|
reactApplicationContext.registerReceiver(receiver, IntentFilter(STOP_BROADCAST))
|
||||||
val stopIntent = Intent(STOP_BROADCAST)
|
val stopIntent = Intent(STOP_BROADCAST)
|
||||||
stopIntent.flags =Intent.FLAG_ACTIVITY_NEW_TASK
|
stopIntent.flags =Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
val pendingStop =
|
val pendingStop =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user