In-App Purchase with Store v2

We are currently trying to get a list of offers from the App Store in our game to display to the users. However, we are struggling to find a way to use

const IOnlineSubsystem* const OnlineSubsystem = IOnlineSubsystem::Get();
IOnlineStoreV2Ptr* StoreInterface = OnlineSubsystem->GetStoreV2Interface();

// This returns null ptr on IOS
const TSharedPtr<const FUniqueNetId> LocalPlayerUNID = IdentityInterface->GetUniquePlayerId(PlatformInterface->GetPlatformUserId());

// Therefore we cannot make a call to this, as cannot dereference the PlayerUNID
StoreInterface->QueryOffersById(*LocalPlayerUNID, ...);

The main issue is we cannot get hold of a valid FUniqueNetId and therefore cannot make the calls to the StoreV2 functions. We know that the “QueryOffersById” in iOS doesn’t actually use the Unique Net ID, but unfortunately the function requires one.

Hi Dune,

As far as I’ve been able to determine, Store V2 just hasn’t been working for UE4 iOS subsystem. To my knowledge anyone who is currently using IAP (at least for a project using the BP IAP nodes, must disable storeV2 in the iOSEngine.ini file. In my own (as yet unpublished) project I use the BP nodes to generate a full list of In App Purchases on offer (as per appstore connect) and then display these via a loop.
I don’t work in cpp and this isn’t a directly relevant answer, but just in case it is of any help here’s an IAP post [Solved] Is anyone sucessfully using BP Make In-App Purchase node on iOS 12.x]([Solved] Is anyone sucessfully using BP Make In-App Purchase node on iOS 12.x - iOS Development - Unreal Engine Forums)

Good luck. Let us know how you go.

Thanks for the info! I have looked over a few posts/questions and found most people still to be using the old store ReadApp nodes it seems. I guess I’ll have to implement this through our C++ classes instead of the new Storev2. I am able to get a call with an empty Unique Net ID, but it then crashes in the iOS function which grabs the data back. This seems to work on Android and other platforms, just annoying how it doesn’t seem to be correctly implemented for iOS (or I’m doing something stupid).

Will keep this updated with any findings.

sir can you make a tutorial on YouTube about in app purchase on Android. Please please i need it

Sorry, this is the Apple iOS sub-forum. Try your questions in the Android forum. I can’t assist with android. Good luck.