swifty-receipt-validator: Multiple Code Errors

Hi, when I add the files I get an 3 errors and a fail warning.

The First error comes up here (Line 328) let receiptBundleID = receipt[ReceiptInfoField.bundle_id.rawValue] as? String ?? "NoReceiptBundleID

Binary operator ‘??’ cannot be applied to operands of type ‘[String : AnyObject]?’ and ‘String’

The seconds comes up at Line 351 receiptProductID = receiptInApp[ReceiptInfoField.InApp.product_id.rawValue] as? String ?? "NoReceiptProductID"

Ambiguous use of ‘subscript’

The third comes up at Line 328 let receiptBundleID = receipt[ReceiptInfoField.bundle_id.rawValue] as? String ?? "NoReceiptBundleID"

Ambiguous use of ‘subscript’

And just a plain warning saying

Cast from ‘MDLMaterialProperty?!’ to unrelated type ‘[AnyObject]’ always fails

At line 343 guard let inApp = receipt[ReceiptInfoField.in_app.rawValue] as? [AnyObject] else

I’ll have a go at it myself and see what I can do

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Great. I will still leave this issue open until I upgraded to Swift 3. Thanks again and happy coding.

I fixed the swift two errors by casting the Any to an NSDictionanry also, It’s fully compatible with swift 3, I just changed the request from a NSMutableURLRequest to an NSURLRequest and changed it from a let to a var. All the other errors can be fixed with a click. So far so good