feat: add nfc step 2 - receive with invoice

This commit is contained in:
2026-06-05 15:43:10 +02:00
parent cc50ff08df
commit 82c048f6c0
13 changed files with 588 additions and 316 deletions
@@ -104,17 +104,12 @@ class WalletNotificationService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
// Step 1: Call startForeground immediately — Android requires this within
// 5 seconds of startForegroundService() or the app is ANR'd.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(
NotificationConstants.NOTIF_ID_SERVICE,
NotificationHelper.buildServiceNotification(this),
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { // API 34
startForeground(NotificationConstants.NOTIF_ID_SERVICE, NotificationHelper.buildServiceNotification(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE)
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(NotificationConstants.NOTIF_ID_SERVICE, NotificationHelper.buildServiceNotification(this), ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC)
} else {
startForeground(
NotificationConstants.NOTIF_ID_SERVICE,
NotificationHelper.buildServiceNotification(this)
)
startForeground(NotificationConstants.NOTIF_ID_SERVICE, NotificationHelper.buildServiceNotification(this))
}
// Step 2: Open the WebSocket. If already open (e.g. service restarted