diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 240302c5c7..fce28b8127 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -14,6 +14,7 @@
+
diff --git a/app/src/main/java/com/alphawallet/app/service/WalletConnectV2Service.java b/app/src/main/java/com/alphawallet/app/service/WalletConnectV2Service.java
index 10855adb14..91290c0b61 100644
--- a/app/src/main/java/com/alphawallet/app/service/WalletConnectV2Service.java
+++ b/app/src/main/java/com/alphawallet/app/service/WalletConnectV2Service.java
@@ -6,6 +6,7 @@
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
+import android.content.pm.ServiceInfo;
import android.os.Build;
import android.os.IBinder;
@@ -59,12 +60,23 @@ private void createNotificationChannel()
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
- @RequiresApi(api = Build.VERSION_CODES.O)
+
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
- createNotificationChannel();
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
+ {
+ createNotificationChannel();
+ }
Notification notification = createNotification();
- startForeground(1, notification);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
+ {
+ startForeground(startId, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC);
+ }
+ else
+ {
+ startForeground(startId, notification);
+ }
+
return START_STICKY;
}
diff --git a/app/src/main/java/com/alphawallet/app/walletconnect/AWWalletConnectClient.java b/app/src/main/java/com/alphawallet/app/walletconnect/AWWalletConnectClient.java
index ab8cc6d954..b41abcb580 100644
--- a/app/src/main/java/com/alphawallet/app/walletconnect/AWWalletConnectClient.java
+++ b/app/src/main/java/com/alphawallet/app/walletconnect/AWWalletConnectClient.java
@@ -9,6 +9,7 @@
import android.app.Application;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.ServiceInfo;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;