- Home /
AppleTangle does not exist - new Unity IAP - get original transaction id iOS
After importing an IAP Update (through Services tab) I had multiple errors. I got rid of the most of them but one still remains. My scripts are not able to find AppleTangle any more. Before the update the code was running fine with using the name space UnityEngine.Purchasing.Sercurity.
I tried setting up a new blank project only with the mentioned script and after importing Unity IAP it got to the same result.
Do note that the use case of the AppleTangle is solely to get the originalTransaction ID of a purchase via its receipt. (see code below) Was there a change of handling this process with recent iOS13 announcements and WWDC ?
Thanks in advance.
private string GetOriginalPurchaseID(Product product)
{
ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
// Get a reference to IAppleConfiguration during IAP initialization.
IAppleConfiguration appleConfig = builder.Configure<IAppleConfiguration>();
string originalID = product.transactionID;
if (!string.IsNullOrEmpty(appleConfig.appReceipt))
{
var receiptData = System.Convert.FromBase64String(appleConfig.appReceipt);
AppleReceipt receipt = new AppleValidator(AppleTangle.Data()).Validate(receiptData);
if (receipt.inAppPurchaseReceipts.Length > 0)
{
originalID = receipt.inAppPurchaseReceipts[0].originalTransactionIdentifier;
}
}
return originalID;
}
Answer by Sylafrs · Feb 18, 2020 at 03:55 PM
Hey, just had the same issue
Found the solution.
The Tangle classes are generated from Window > IAP Obfuscator. If you only develop for Apple, don't mind adding anything in the secret field, just press the generate button.
Haven't tested yet, I'll keep you updated :)
Your answer
Follow this Question
Related Questions
Unity IAP for iOS PurchaseProcessingResult.Pending and App restart. The buying process is not work 0 Answers
Unity IAP - Works in Editor; Fails in XCode, Fails in Testflight (iOS) 1 Answer
How to set codeless IAPButton OnPurchaseComplete callback through code 1 Answer
How to add IAP to my iOS game? 0 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers