`Bundle.main.appStoreReceiptURL` returns wrong url when using StoreKit configuration file and running iOS app on macOS (m1)
tikhop opened this issue · 6 comments
same behavior here :( (Mac mini M1)
Hi @macoapps, I'm sorry, I just can't try it by myself, since I don't have an access to m1 machine.
Do you have a chance to check what's the right url on your machine and what comes from Bundle.main.appStoreReceiptURL
?
Thanks,
Pavel
Hi @tikhop,
tried to print appStoreReceiptURL value in func appStoreReceiptData(), return nil with iPhone 12 simulator running on Mac mini M1.
Printing Bundle.main.appStoreReceiptURL?.path on AppDelegate gives me this :
-> using iPhone 12 Pro as simulator
nil
-> using My Mac M1 as simulator
/Users/XXXXXX/Library/Containers/E5CDC364-608E-4C8F-8E5B-FFE578B304D7/Data/StoreKit/sandboxReceipt
I'll check if I can run my app on my Mac but I'll have to solve other errors (not in TPInAppReceipt ;))
Hi @macoapps,
Thanks for providing extra information. Seems that it returns the right path for m1 device. For iPhone simulator, it can be nil
, as I know, when you run the app for the first time (When user downloads the app from AppStore, the local receipt is available right away). In order to get a receipt on simulator you must make a purchase or refresh your receipt:
InAppReceipt.refresh { (error) in
print(error)
}
NOTE: User gets a prompt to sign into the store to download the receipt when InAppReceipt.refresh(completion:)
is being called.