Hi,
I sell about 160 non-consumable items. When restoreing items, my app often crashes.
I investigated the cause of crash, I noticed a device memory usage increased from 300MB to 2GB when restoreing items.( the device has all non-consumable items). I guess that restoreing process tends to crash with bad network connection.
I think some users who have a lot of items cannot restore their items. How can I avoid this high memory usage?
By the way, according to user logs, purchasing in iOS have more trouble than Android. ( initializing iap failure, purchasing failure reason ‘unknown’ )
I hope these issues are fixed fiexed in the next version.
Unfortunately we don’t have any control over this as we are just a pass through for the store API. Please reproduce and provide the device logs How To - Capturing Device Logs on iOS For any other issues that you might be seeing, please also provide specific steps to reproduce so we can confirm.
I’m really sorry.
As more investigation, this kind of crash looks rare case.
And the large memory usage happen when initializing unity iap, not restoring process.
But some iPhones accutually use large amout of device memory.
I will show the details.
My app information.
1:The app has a lot of non-consumable items. ( about 160 )
2:When first launching the app after installing, the app restore the items just after initializing unity iap.
There is a large amount of initializing items logs when initializing Unity IAP. I think there is no useful logs.
So I will show the one of them.
UnityIAP: Promo interface is available for 47 items
UnityEngine.Purchasing.Promo:ProvideProductsToAds(HashSet`1)
UnityEngine.Purchasing.JSONStore:OnPurchaseSucceeded(String, String, String)
UnityEngine.Purchasing.Extension.UnityUtil:Update()
I could reproduce this on my iPhoneX. ( OS : 12.4.1 )
I show memory usage graph of my device. Check the screenshot.
However, I checked the memory usage on some iPhone devices, but I could not reproduce the very high memory usage when initializing Unity IAP.
I wonder why the behaviour is so different depending on the device
By the way, I try Unity IAP 1.23.0 and memory usage get worse than previous.
So you have 47 items not 160, but that’s ok. If you can find reliable steps to reproduce on a specific phone model and/or iOS version, please let us know.
I finally find the cause of the memory problem!
On iOS, yet I couldn’t specify the device model nor OS version, some devices consume a large amount of memory when creating an instance of CrossPlatformValidator.
I had misunderstood that the problem is Unity IAP’s initializing process because I create the instance of CrossPlatformValidator on OnInitialized method:(
I don’t know why some devices use so much memory when creating an instance of CrossPlatformValidator.
Instead of CrossPlatformValidator class, creating an instance of AppleValidator cause no memory issues. But I couldnt use AppleValidator because there are few documentation…
So, I gave up validating receipts on iOS.
Is CrossPlatformValidator class not recommended to use on iOS ?
I’m sorry I could not find the reliable reproduce process yet.
iPad 12.3.1
I tested with the same AppleID which has a lot of items.
Among the devices, only iPhoneX has the memory issue.
From users information, iPhone6 and OS 12.4.2 seem to have this kind of problem with a high probability.
I couldn’t specify the device model nor OS version…