xcodede aldığım hata buradaki :
func updtFCMToServer(){
//update fcm id
if UserDefaults.standard.bool(forKey: "isLogedin") {
let duser = try! PropertyListDecoder().decode(User.self, from: (UserDefaults.standard.value(forKey:"user") as? Data)!)
print(duser)
if duser.userID != ""{
if(Reachability.isConnectedToNetwork()){
let apiURL = "user_id=\(duser.userID)&fcm_id=\(Apps.FCM_ID)"
self.getAPIData(apiName: "update_fcm_id", apiURL: apiURL,completion: LoadResponse)
}
}else{
print("user ID not available. Try again Later !")
}
}
}
hata ise bu:
Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.keyNotFound(CodingKeys(stringValue: "ref_code", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"ref_code\", intValue: nil) (\"ref_code\").", underlyingError: nil)): file /Users/macbook/Downloads/Main Code/App Code/Quiz-Online-1.2/Quiz/SystemConfig.swift, line 17
xcodeden anlayan varsa nerde hata yapıyorum ben