Search code examples
iosin-app-purchaseswift3receipt-validation

Cannot pass immutable value as inout argument: implicit conversion from 'UnsafePointer<UInt8>? to 'UnsafePointer<UInt8>?' require a temporary


I have written a method for parsing Receipt of InAppPurchase in Swift2.3 and now I am converting it to Swift3. So I am getting this error. Anyone has idea, how to fix this?

Receipt Parsing Error in Swift 3


Solution

  • Try like this,

    var p: UnsafePointer<UInt8>? = (data as NSData).bytes.bindMemory(to: UInt8.self, capacity: data.count)