And I looked in crash history, this crash happens since last two versions, from iOS 10.3.3 to iOS 11.2.2, I can't reproduce it, not sure if it's relates to this library.
Here is my code, I get my product information and verifies it when my app starts.
class ItunesModule {
public static let shared = ItunesModule()
init() {
getProductInfo {
self.verifyReceipt()
}
}
public func getProductInfo(callback: @escaping () -> Void) {
if let product = Product('identifier') // Product is a struct contains information like SKProduct.
RMStore.default().requestProducts(
[product.identifier],
success: { [weak self] results, _ in
if let products = results as? [SKProduct] {
if let result = (products.filter { $0.productIdentifier == product.identifier }).first {
product.localizedTitle = result.localizedTitle
product.localizedDescription = result.localizedDescription
product.price = result.price
self?.product = product
self?.postNotification(named: NotificationName.didRetrieveGoProInfo)
callback()
}
}
},
failure: { error in
log.error(error.debugDescription)
}
)
}
func verifyReceipt() {
if let receipt = RMAppReceipt.bundle() {
product.available = verify(product, inReceipt: receipt)
}
}
func verify(_ product: Product, inReceipt receipt: RMAppReceipt) -> Bool {
return receipt.bundleIdentifier == Bundle.mainBundleIdentifier &&
receipt.verifyReceiptHash() &&
receipt.inAppPurchases.count > 0 &&
receipt.contains(inAppPurchaseOfProductIdentifier: product.identifier)
}
}
I'm using RMStore for my iOS project, which is written in Swift. In last two days I receive many (like 88 times) crash logs, affects 5 users:
And I looked in crash history, this crash happens since last two versions, from iOS 10.3.3 to iOS 11.2.2, I can't reproduce it, not sure if it's relates to this library.
Here is my code, I get my product information and verifies it when my app starts.