The problem is this, passing in intent two values for one key:
val allowIntent = Intent(this, PaymentIntentService::class.java) allowIntent.putExtra("button", true) val serviceAllowIntent = PendingIntent.getService(this, 1, allowIntent, 0) val cancelIntent = Intent(this, PaymentIntentService::class.java) cancelIntent.putExtra("button", false) val serviceCancelIntent = PendingIntent.getService(this, 0, cancelIntent, 0) After that, the place where I get these values, I try to call the getSessionData() method, but alas, it does not reach it, because for some reason getBooleanExtra () does not work quite correctly, but does not find the value by the button key:
if (intent.extras != null) { if (intent.extras.containsKey("button") && intent.extras.containsKey("sessionSecret")) { allow = intent.getBooleanExtra("button", true) getSessionData() } } else cancelNotification() Perhaps because I check first intent.extras and then I work with getBooleanExtra () I don’t know, but I don’t see any alternatives to get the values I need by the key.
intent.hasExtra("button") && intent.hasExtra("sessionSecret"), without touchingextras? - woesssPendingIntent. For example,PendingIntent.getService(this, 1, allowIntent, PendingIntent.FLAG_UPDATE_CURRENT);- eugeneek