Skip to content

Conversation

@ovitrif
Copy link
Collaborator

@ovitrif ovitrif commented Jul 23, 2024

Resolves #synonymdev/bitkit/2038

  • Handle data-only-notification for wake2pay POC
    Wakeup LDK node, sync it, connect peer and pay the bolt11 invoice from the payload
    • All these OPs are done on the BG thread in a non-blocking fashion from within a CoroutineWorker, ie. one that supports suspending work.
  • CLI app for testing FCM(Firebase Cloud Messages) in ./tools/fcm-tester/
  • .editorconfig for uniform formatting & cleanup of ldk code

Note

Since the Android OS would kill a Worker that takes longer than allowed by the OS, the POC already demonstrates the most basic setup* for wake2pay shout run flawlessly.

* When the user has already had opened the native app and had a channel open with the LSP, all of which would be backed-up on the device by LDK/ldk-node and readily to be "reloaded" as it was done to test this PoC.

To Test

  • It is expected that you already had a channel with the default peer.
  • Once that is in place, close the app, comment out the last 2 lines in LauncherActivity.onCreate, ie. LauncherActivity.kt:21 and LauncherActivity.kt:22:
class LauncherActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        initNotificationChannel()
        logFcmToken()
        // warmupNode(filesDir.absolutePath)
        // startActivity(Intent(this, MainActivity::class.java))
    }
}
  • Run the app again and background it by going to the os' home screen.
  • Check ./tools/fcm-tester/README.md on how to send a remote message that should trigger the wake2pay.
  • Expect Result.Success from the background worker.

@ovitrif ovitrif requested a review from Jasonvdb July 23, 2024 14:43
@ovitrif ovitrif force-pushed the feat/poc-wake2pay branch from e354a29 to 8e6a4dc Compare July 23, 2024 14:46
@ovitrif ovitrif force-pushed the feat/poc-wake2pay branch from 8e6a4dc to ce97d4e Compare July 23, 2024 14:50
@ovitrif ovitrif linked an issue Jul 23, 2024 that may be closed by this pull request
@ovitrif ovitrif changed the title POC wake2pay from remote notification POC wake2pay from notification Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android - Native notification POC

3 participants