Make In-App purchase works weird

  1. I used Make an In-App Purchase node to purchase in-app item.

  2. 's app -purchase popped up and I purchased it.

  3. transaction was completed.

  4. But, Unreal’s log says "

    D/UE4 (16126): [JNI] - AndroidThunkCpp_Iap_IsAllowedToMakePurchases
    D/UE4 (16126): [JNI] - AndroidThunkCpp_Iap_BeginPurchase
    D/UE4 (16126): OnAppCommandCB cmd: 12
    D/UE4 (16126): LogAndroidEvents: EnqueueAppEvent : 12, 0
    D/UE4 (16126): OnAppCommandCB cmd: 13
    D/UE4 (16126): LogAndroidEvents: EnqueueAppEvent : 6, 0
    D/UE4 (16126): OnAppCommandCB cmd: 7
    D/UE4 (16126): LogAndroidEvents: EnqueueAppEvent : 10, 0
    D/UE4 (16126): 1… ProductId: , ReceiptData:
    D/UE4 (16126): OnAppCommandCB cmd: 11
    D/UE4 (16126): LogAndroidEvents: EnqueueAppEvent : 7, 0
    D/UE4 (16126): OnAppCommandCB cmd: 6
    D/UE4 (16126): LogAndroidEvents: EnqueueAppEvent : 11, 0
    D/UE4 (16126): In-App Purchase was completed unsuccessfully
    D/UE4 (16126): 2… ProductId: , ReceiptData:

as you can see, productid and receiptdata is null.
In addition to it, ProductId: ,ReceiptData was shown two times for a single purchase.

  1. So I tried again on the same item.

  2. 's in-app purchase pop-up didn’t show up instead I got the response of the purchase that I did before.

    D/UE4 (16126): [JNI] - AndroidThunkCpp_Iap_IsAllowedToMakePurchases
    D/UE4 (16126): [JNI] - AndroidThunkCpp_Iap_BeginPurchase
    D/UE4 (16126): 1… ProductId: item_premium, ReceiptData: eyJvcmRlcklkIjoiR1
    BBLjEzNjAtOTUyNS0zMjI2LTEzMzgxIiwicGFja2FnZU5hbWUiOiJjb20uWW91ckNvbXBhbnkuV2FuZ0
    JhbEUiLCJwcm9kdWN0SWQiOiJpdGVtX3ByZW1pdW0iLCJwdXJjaGFzZVRpbWUiOjE0Mzg2NTg1MjA0MD
    gsInB1cmNoYXNlU3RhdGUiOjAsImRldmVsb3BlclBheWxvYWQiOiJ1ZTQuaXRlbV9wcmVtaXVtIiwicH
    VyY2hhc2VUb2tlbiI6Im1sZHBsZ2loaW5mZ2JmaGFhYXBmamxiZS5BTy1KMU93Z1JXNDFsZ1lZWnhQd2
    ZoeUpjWmNsZ2FlWklYbU83SVppeTNQWlFveVJrMkkzOG9BTkM2ZlVYM3BjMWlaUjV1dzhRdjREd2xFUz
    M2YUFJekR4UTc2TDB2R0ZBTHFIRXpzTVY4el9kS2JDVWRhZUFXVnduSmNvWWxuS296UjRXeDRSbU5DZy
    J9
    D/UE4 (16126): In-App Purchase was completed successfully
    D/UE4 (16126): 2… ProductId: item_premium, ReceiptData: eyJvcmRlcklkIjoiR1
    BBLjEzNjAtOTUyNS0zMjI2LTEzMzgxIiwicGFja2FnZU5hbWUiOiJjb20uWW91ckNvbXBhbnkuV2FuZ0
    JhbEUiLCJwcm9kdWN0SWQiOiJpdGVtX3ByZW1pdW0iLCJwdXJjaGFzZVRpbWUiOjE0Mzg2NTg1MjA0MD
    gsInB1cmNoYXNlU3RhdGUiOjAsImRldmVsb3BlclBheWxvYWQiOiJ1ZTQuaXRlbV9wcmVtaXVtIiwicH
    VyY2hhc2VUb2tlbiI6Im1sZHBsZ2loaW5mZ2JmaGFhYXBmamxiZS5BTy1KMU93Z1JXNDFsZ1lZWnhQd2
    ZoeUpjWmNsZ2FlWklYbU83SVppeTNQWlFveVJrMkkzOG9BTkM2ZlVYM3BjMWlaUjV1dzhRdjREd2xFUz
    M2YUFJekR4UTc2TDB2R0ZBTHFIRXpzTVY4el9kS2JDVWRhZUFXVnduSmNvWWxuS296UjRXeDRSbU5DZy
    J9

The log is showing a duplicated log of the purchased item.

I already asked about this with a different title, but I didn’t get the solution.
So I added the log related to this.

Hey ,

I have sent an email to our developer and hoping to hear back soon. It may be a couple of days before I hear back. Either the developer will contact you directly through here, or I will update you with more information as I receive it. Please let us know if you have any further questions, have a great day! :slight_smile:

Hey,

I have heard an update from the developer, they’re planning on contacting you today or tomorrow. Thanks for your patience! :slight_smile:

Hi ,

It seems something went wrong on the server end and the two you’ve received in your next request are the prior and the new product responses.

Do you happen to have the related to this?

/

Yes. It happens every time and is also related to the link I attached.

Hey , Could you attach your please?

/

hm… Is there a way to save a log without modifying full source?
I edited engine source to get a log in shipping build for android device.
So that is all about log I can get.

As you know, In-app functions work only on shipping build except development build.

As I said before, it is not possible to test IAP with development build.

Because 's transaction fails.

All I did was simply to purchase an item surely with shipping builds not on development builds.

Hey , What issues have you had testing IAP with development builds?

/

Hi , I am gonna be in and around this code this week, Ill look into your issue and see if I can replicate.

/

Hey ,

We have not been able to reproduce this. Are you still experiencing this issue in 4.9?

Thanks!

Do you mean that you have an in-app testing in shipping build on googleplay market?
I thinnk there is nothing I can explain more. That and blueprints say everything.

Yes, I’m still experiencing. Nothing has changed in 4.9. So I’m considering not to use in-app instead of launching two apps; free version and paid version.

Em… I want to make sure of that.
The problem is that the result of 's transaction and unreal’s result don’t correspond.
When 's pop-up shows ‘success’, unreal says ‘unsuccessful’.
So I can’t do proper actions on success pin on blueprint node.

I’m not talking about whether purchasing an item is possible or not.

Hey ,

Can you attach the game from the device where this is failing. I’d like to see if anything useful has been output.

/

I’m trying to leave a log in shipping build. For enabling logging I did was that put a line ‘UEBuildConfiguration.bUseLoggingInShipping = true’ in MyGame.Target.cs and commented out #define lines in AndroidMisc.cpp.

Is there anything else missing? I want to leave a verbose log.

Hey ,

The “Test” configuration should be sufficient for this. You can build your target with test, as opposed to development or shipping, that oughta be okay. Lemme test this again today/tomo and Ill get back to you.

Thanks.

Em, I don’t understand. I was able to find Test Configuration in Project Launcher, but In packaging was not. Is it possible to make a package by test configuration? I mean in editor. Test configuration is only shown in visual studio project.

Hey ,

Actually, it doesnt look like Test builds can be configured from the Package Project menu.

This seems like an oversight. The package project action runs a UAT “buildcookrun” command. It may be possible to configure the “-clientconfig=” option to point to Test, as opposed to development.

You can find this commandline in your log btw. It is output when you choose to package a project.

Ill be testing this out at some point today too, I expect.

/

Thank you. I was able to see the log.

I attached.[link text][1]

59930-log.txt (6.96 KB)

By seeing the log, I figured out what the problem was.

Situation 1. (with unchecking “IsConsumable”)
as that log showed, the transaction’s result(Success) and UE4’s result(Failure) didn’t correspond.

Situation 2. (with checking “IsConsumable”)
Everything was OK, It worked as expected.

The problem only happens with Unchecking “ISConsumable”, I guess.

Awesome, thanks for the clarity . And the workaround.

I’ll take a look locally and see if I can find the suitable fix.

/

Hello , it appears I have a similar problem with yours.
Is there anything else you changed except is consumable option, to get it work?
my blueprint:

In this blueprint on failure node hits no matter what, even if the has made the purchase and the money went to my account.