KotlinNoob
Lurker
Hello to everyone... I am new here 
I am trying to create a simple InApp subscription purchase as one file (all within MainActivity.kt)
Just one SKU SUB for 1 month period. Thats it
What do you think about nesting almost all the code withing one button?
On click ->
-Starts the BillingClientConnection
-Checks if Subscriptions Feature supported
-Then makes querySkuDetailsAsync for details about only 1 subscription
... and on received result to start the purchase flow?
I am now kinda stuck at receiving result from querySkuDetailsAsync
when (billingResult.responseCode) {
BillingClient.BillingResponseCode.OK -> {
if (skuDetailsList.orEmpty().isNotEmpty()) {
Toast.makeText(applicationContext, "Cool!", Toast.LENGTH_LONG).show()
}
else
{
Toast.makeText(applicationContext, "Not cool!", Toast.LENGTH_LONG).show()
//////////// I AM HERE NOW///////////////
// Toast shows "Not cool!"
////////////////////////////////////////////////////
}
}
}
Whole code: https://pastebin.com/eGLKjAzH
What I did until now:
-I have created developer account and merchant account.
-I have compiled the code by using "Generate Signed Bundle/Apk" where I created the new Key
-I have created the new listing for a test app in Internal test, uploaded file, and status is:
"Available to internal testers "
-I have added my test email in list with testers
-I have added my email in the list with License testers and set option "Licensed"
-I got url for downloading test app... which at the moment shows
" We're sorry, the requested URL was not found on this server. "
but ok, i guess that it is as stated... that it can take up to 48h for first time published app to become available to testers...
Probably thats why I dont receive anything in the query... Even though I am using the signed app with the same uploaded key... but... Offline version of app. I couldnt test how it works when downloaded
So.. While I am waiting for app to become available for download I would like to research more about the whole InApp Testing and in general InApp purchase...
So.. If it is not a broblem, to ask few more questions:
Can I use my custom key when compile app for purpose of internal test? Or I have to use public key?
Can I use my custom key when compile final app for purpose of publishing in production? Or I have to use public key?

I am trying to create a simple InApp subscription purchase as one file (all within MainActivity.kt)
Just one SKU SUB for 1 month period. Thats it
What do you think about nesting almost all the code withing one button?

On click ->
-Starts the BillingClientConnection
-Checks if Subscriptions Feature supported
-Then makes querySkuDetailsAsync for details about only 1 subscription
... and on received result to start the purchase flow?
I am now kinda stuck at receiving result from querySkuDetailsAsync
when (billingResult.responseCode) {
BillingClient.BillingResponseCode.OK -> {
if (skuDetailsList.orEmpty().isNotEmpty()) {
Toast.makeText(applicationContext, "Cool!", Toast.LENGTH_LONG).show()
}
else
{
Toast.makeText(applicationContext, "Not cool!", Toast.LENGTH_LONG).show()
//////////// I AM HERE NOW///////////////
// Toast shows "Not cool!"
////////////////////////////////////////////////////
}
}
}
Whole code: https://pastebin.com/eGLKjAzH
What I did until now:
-I have created developer account and merchant account.
-I have compiled the code by using "Generate Signed Bundle/Apk" where I created the new Key
-I have created the new listing for a test app in Internal test, uploaded file, and status is:
"Available to internal testers "
-I have added my test email in list with testers
-I have added my email in the list with License testers and set option "Licensed"
-I got url for downloading test app... which at the moment shows
" We're sorry, the requested URL was not found on this server. "
but ok, i guess that it is as stated... that it can take up to 48h for first time published app to become available to testers...
Probably thats why I dont receive anything in the query... Even though I am using the signed app with the same uploaded key... but... Offline version of app. I couldnt test how it works when downloaded

So.. While I am waiting for app to become available for download I would like to research more about the whole InApp Testing and in general InApp purchase...
So.. If it is not a broblem, to ask few more questions:
Can I use my custom key when compile app for purpose of internal test? Or I have to use public key?
Can I use my custom key when compile final app for purpose of publishing in production? Or I have to use public key?