Can't get Read IAP node to work

I have been trying to solve this for about a week. I followed the Match 3 project on the Learn tab for setting up IAPs in my app. After many failed attempts to get this working, I started working it step by step to see where the error was occuring. First step was to see whether or not the app was logging in. Step 1 passed.

Step 2 was to see if it was reading the product IDs and purchase info. I set this up via a text bind using a string with the matching product ID locally and setting the price for said item in a text block. All IDs came back “Unset.” This tells me it most likely is NOT accessing my products.

Here is the code I used and the resulting product:

Code3.jpg

Can anyone tell me how to fix this?

Also, this app has been published to a beta via google play developer console.

I assume you are running this on mobile, because it will not work in the IDE.

Only three things I can immediately think of are: did you set your Google Play License within settings under Android, have you tried directly putting in your product id into the make array without use of a variable, and have you confirmed you’re using the correct product id as it’s shown in your Google Dev Console?

Yes, I am downloading the app directly from google play as a beta tester. I tried inputting the product ID into the make array node, but got the same result as above. License is in the settings as well. I directly copied and pasted the product ID from my developer console, so I know there were no typos there either.

Since you’ve been at this for about a week I also assume the IAP IDs have been added for at least 24 hours. Make sure they are active within the Google Dev Console. What happens if you try to start a purchase on a specific ID? It should bring up the product if it’s working right, or generate an error which might provide us with more information. There’s always logcat as well, you’ll need to find a guide on that.

Also, you don’t need to upload a new APK every change, the APK just has to match the version of what’s on your console, and you can then sideload it to your phone. It MAY have to be marked as distributed/shipping but I could definitely be wrong on that.

All IDs are active since Monday this week. I set up a hidden box in my store widget to become visible if the purchase fails. When I click “Yes,” it doesn’t attempt to make the purchase at all. It brings up the failed box I set up.

I was not aware of the fact I didn’t need to upload every time, so thanks for that tip.

Yes, I have it set to run the Is Logged In node>branch>False>Show External Login as soon as the store widget opens.

The only other thought I keep coming back to is the google play license key. Not the twelve digit App ID, but the other code. I have it set to the Base64-encoded RSA code. Is this the key it is looking for?

Yes, it’s the Base64 one. Try calling the show external login UI anyway.

Clear out any setting files for your app(or if you use the bat file to push to your phone that UE4 generates, it’s already done).

Look up your app info on your phone and select ‘clear data’. Can often be found by long pressing on your launcher, or by viewing Apps/Applications in settings.

And although I doubt this is related, click Storage in your phone settings and clear cache, it’s harmless but can fix corrupt settings.

I doubt it’s something related to your phone but can’t hurt to try those things. I’ll show you my work tomorrow. GL.

The only other thing that immediately comes to mind is your Google Logon status. You said you checked if the app was logging in, are you referring to the “is logged in” node for Google Services? Try Show External Logon UI anyway(I believe it’s called that). I don’t think you can make purchases without first logging into Google Services.

If that doesn’t work I’ll upload my working code tomorrow, it’s fairly short.

Clearing the data and cache did not work either.

Okay, so there are a couple things I forgot to mention worth looking into.

Make sure when you build your game UE4 is adding the following to your ManifestRequirements:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET"/>

The above should automatically be included so I doubt that’s the problem, but check just in case. Make sure your min/target/max sdk are set properly. I think you can ignore the max one. I don’t believe this has much relevance with in-app purchases either but as before just being thorough.

However: something that absolutely will break your project is if you don’t have your DefaultEngine.ini setup. DefaultEngine.ini can be found in the Config folder.

The following should be included if you plan on using in-app purchases and achievements/leaderboard:

[OnlineSubsystem]
DefaultPlatformService=GooglePlay

[OnlineSubsystemGooglePlay.Store]
bSupportsInAppPurchasing=True

Make sure your purchaseIDs and RSA key don’t have spaces before or after them. Spaces are common when pasting into UE4.

Other than that there is nothing else I can think of to be causing your problems. Here is my setup to compare against.

99782-in-app-console.jpg

ok, I was missing the portion in the .ini file as well as one of the permissions. But, it is still failing. Do I have the permissions in the proper spot of my project settings?

From what you’ve shown me it all seems appropriate. If you check the manifest generated after you compile you’ll see your permissions in there. Are you compiling as debug or distributable? I don’t know if the key used to sign the apk matters or not. It may have to match the key in the uploaded Google developer console version. Otherwise I’m out of ideas on this one. You may have to check your logcat.

It is compiled as distributable. Does it matter in the .ini file you mentioned before as to WHERE I place that bit of code? I placed it at the end.

It doesn’t matter where you put the INI data long as it doesn’t cut into other settings as this would break other settings. Beginning or end is fine.

Additional info on INI files…
Think of each section in brackets a structure type. Example [STRUCTURE1], and every Value=xxxx below that structure as a variable in the structure. Every Value= you place belongs to the STRUCTURE directly above it.

If you can view logcat I’d see what it says when you initiate the purchase or read in app information. Short of looking at the project I’m not sure what’s wrong, sorry.