Skip to content

Commit

Permalink
prepare bs broadcast receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Apr 22, 2024
1 parent d3be63a commit 77a9b8e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@
<meta-data android:name="photopicker_activity:0:required" android:value="" />
</service>

<receiver android:name=".other.BurningSeriesReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="dev.datlag.aniflow.BS_BROADCAST" />
</intent-filter>
</receiver>

<meta-data
android:name="instantapps.clients.allowed"
android:value="true"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package dev.datlag.aniflow.other

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import dev.datlag.aniflow.model.ifValueOrNull

open class BurningSeriesReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
intent?.let { i ->
val seriesHref = i.getStringExtra("href")?.ifBlank { null } ?: return@let
val watched = i.getIntExtra("watched", -1).ifValueOrNull(-1) { return@let }

// ToDo("check connected href and set watched status")
}
}
}

0 comments on commit 77a9b8e

Please sign in to comment.