Problem in In-App Purchase setup on iOS

I have searched whole internet for the solution, no success :frowning:

Same code works for Android with no issue.

Here’s what was done so far.

On Apple side

  • Cleared for Sale is checked
  • In-App purchase products are submitted
  • In-App purchase product IDs have this syntax: com.companyname.gamename.consumableproduct.packnumber
  • Bundle identifier and most of other things are setup, which require app for uploading to itunes connect with application loader
  • Testing with TestFlight and Sandbox accounts are also configured, but game fails to retrieve In-App Purchase product details.

On UE4 side

  • Packaging with Development build, DebugGame, Shipping with Distribution works
  • Debugging with Xcode is partially setup (Engine symbols present on dSYM file but breakpoints do not hit)
  • Correct development and distribution provisioning profiles setup correctly (In-App purchase checkbox is enabled there).

Read In-App purchase Information node always returns failed callback, while the same code works on Android.

Engine/Config/IOS/IOSEngine.ini is set up like this

[OnlineSubsystem]
DefaultPlatformService=IOS

[Advertising]
DefaultProviderName=IOSAdvertising

[DeviceProfileManager]
DeviceProfileSelectionModule="IOSDeviceProfileSelector"

[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
bEnableGameCenterSupport=True

[OnlineSubsystemIOS.Store]
bSupportsInAppPurchasing=true
bUseStoreV2=false

The only useful debugging log from Xcode:

========= This app is in LANDSCAPE mode
LogOnline:Display: FOnlineSubsystemIOSModule::StartupModule()
2017-06-16 22:09:44.462129+0400 Adventures[2706:380188] LogInit:Display: RandInit(17780007) SRandInit(17780008).
2017-06-16 22:09:44.462446+0400 Adventures[2706:380188] LogTaskGraph: Started task graph with 5 named threads and 6 total threads with 1 sets of task threads.
2017-06-16 22:09:44.462529+0400 Adventures[2706:380188] LogStats: Stats thread started at 0.377944
2017-06-16 22:09:44.462596+0400 Adventures[2706:380188] LogOnline:Display: FOnlineSubsystemIOSModule::StartupModule()
LogOnline:Display: FOnlineSubsystemIOS::Init()
2017-06-16 22:09:44.462833+0400 Adventures[2706:380188] LogOnline:Display: FOnlineSubsystemIOS::Init()
LogOnline:Display: FOnlineSessionIOS::FOnlineSessionIOS(FOnlineSubsystemIOS* InSubsystem)
2017-06-16 22:09:44.463016+0400 Adventures[2706:380188] LogOnline:Display: FOnlineSessionIOS::FOnlineSessionIOS(FOnlineSubsystemIOS* InSubsystem)
LogOnline:Display: FOnlineLeaderboardsIOS::FOnlineLeaderboardsIOS()
2017-06-16 22:09:44.463664+0400 Adventures[2706:380188] LogOnline:Display: FOnlineLeaderboardsIOS::FOnlineLeaderboardsIOS()
LogOnline:Display: FOnlineSubsystemIOS::FOnlineAchievementsIOS()
2017-06-16 22:09:44.463781+0400 Adventures[2706:380188] LogOnline:Display: FOnlineSubsystemIOS::FOnlineAchievementsIOS()

LogOnline:Warning: Problem in iTunes connect configuration for product: com.xxx.xxxxx.xxxx.xx
2017-06-16 22:10:38.407257+0400 Adventures[2706:380188] [2017.06.16-18.10.38:407][132]LogOnline:Warning: Problem in iTunes connect configuration for product: com.xxx.xxxxx.xxxx.xx

This warning is called in OnlineStoreIOS.cpp of OnlineSubsystemIOS plugin

void FOnlineStoreIOS::OnProductPurchaseRequestResponse(SKProductsResponse* Response, const FOnQueryOnlineStoreOffersComplete& CompletionDelegate)
{
	if(bIsQueryInFlight)
	{
		bool bWasSuccessful = [Response.products count] > 0;
		int32 NumInvalidProducts = [Response.invalidProductIdentifiers count];
		if ([Response.products count] == 0 && NumInvalidProducts == 0)
		{
			UE_LOG(LogOnline, Warning, TEXT("Wrong number of products [%d] in the response when trying to make a single purchase"), [Response.products count]);
		}
		
		TArray<FUniqueOfferId> OfferIds;
		for (SKProduct* Product in Response.products)
		{
			FOnlineStoreOfferIOS NewProductOffer(Product, ConvertProductToStoreOffer(Product));
			
			AddOffer(NewProductOffer);
			OfferIds.Add(NewProductOffer.Offer->OfferId);
			
			UE_LOG(LogOnline, Log, TEXT("Product Identifier: %s, Name: %s, Desc: %s, Long Desc: %s, Price: %s IntPrice: %d"),
				   *NewProductOffer.Offer->OfferId,
				   *NewProductOffer.Offer->Title.ToString(),
				   *NewProductOffer.Offer->Description.ToString(),
				   *NewProductOffer.Offer->LongDescription.ToString(),
				   *NewProductOffer.Offer->PriceText.ToString(),
				   NewProductOffer.Offer->NumericPrice);
		}
		
		for (NSString *invalidProduct in Response.invalidProductIdentifiers)
		{
			UE_LOG(LogOnline, Warning, TEXT("Problem in iTunes connect configuration for product: %s"), *FString(invalidProduct));
		}
		
		CompletionDelegate.ExecuteIfBound(bWasSuccessful, OfferIds, TEXT(""));
		bIsQueryInFlight = false;
	}
}

All of my In-App products are in Response.invalidProductIdentifiers

I also compared standard IAP implementations with UE4 OnlineSubsystemIOS, not much difference.

Here’s In-App Purchase settings from ITunes connect

Maybe I missed something, but If more information is needed, I will provide.

It’s still not clear for me whether the problem lies on Apple backend or on game.

Please help :frowning:

I see, that it really doesn’t work. Even with SDKBOX plugin, everytime failure on make purchase, failure on read purchase info…

Did you find anything about this problem? I’m in the same situation as you, read and restore return nothing, make purchase always return failed

Can you make InAppPurchases?

By the way, using SDKBOX solves the problem with Reading purchase information, but I still can’t buy anything. Maybe it depends on my Development build instead of Shipping…

Does anyone know if purchases are allowed in development builds?

mister_dan, you can make sure that your agreements and tax info is correctly set up as shown in this link

Yes, atually I didn’t correctly setup mobile purchases in iTunes. I’ve sent the message to Apple to bring me the functionality of adding purchases to applications in iTunes Connect application page. So it is my mistake, thank you.

This is a major issue I’ve encountered as well, and has stopped me from releasing my app so far. I’ve followed the documentation for IOS in-app-purchases closely; however, the purchase always fails. The Blueprint is correct, the i-Tunes connect setup is correct, and as far as I’m aware, the IOSEngine.ini file is correct. My project is made with 4.16.2 it would be difficult and time consuming to downgrade engine versions, and I shouldn’t have to for a basic and essential mobile feature to work in the first place.

I wrote my own plugin that solves this. Available here: GitHub - apmason/UEAppleIAPPlugin