From 06e8cbe69c8b25f59798b1c18df5a90afd103f7e Mon Sep 17 00:00:00 2001 From: Samwel Date: Thu, 4 Jul 2024 22:29:43 +0300 Subject: [PATCH] code optimization --- .../mpesaintegrationandroid/MPESAMessagingService.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MPESAMessagingService.java b/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MPESAMessagingService.java index a60b6bc..b6b6f97 100644 --- a/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MPESAMessagingService.java +++ b/app/src/main/java/com/mpesaandroidintegration/mpesaintegrationandroid/MPESAMessagingService.java @@ -11,13 +11,8 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; - import org.json.JSONObject; -/** - * Created by miles on 20/11/2017. - */ - public class MPESAMessagingService extends FirebaseMessagingService { private static final String TAG = "MPESAMessagingService"; @@ -95,7 +90,7 @@ private void sendNotification(String title, String message) { Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent, - PendingIntent.FLAG_ONE_SHOT); + PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); NotificationCompat.Builder notificationBuilder =