I am using the below code for getting expiry date from the receipt validation response and it is failing for some users only (in production) and works fine for others.
Can anyone spot what I am doing wrong here? Any comments will be appreciated.
func getExpirationDateFromResponse(_ jsonResponse: NSDictionary) -> Bool{
if let receiptInfo: NSArray = jsonResponse["latest_receipt_info"] as? NSArray {
var hasActiveSubscription : Bool = false
for receipt in receiptInfo {
let receipt_ = receipt as! NSDictionary
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss VV"
if let date = formatter.date(from: receipt_["expires_date"] as! String) {
if date > Date() {
hasActiveSubscription = true
break;
}
}
}
return hasActiveSubscription
}
else {
return false
}
}
Post
Replies
Boosts
Views
Activity
Thanks for help in advance.
Got Error while adding App to the External testers as "Some of the information required to submit your build for external testing is missing.".I am trying to fix this issue s from 3 days onwards.But I still stuck.