I am finalizing an IOS app (xcode9, swift 4) using pushpad. When the app installs it asks the user to register "Notifications", then runs NetworkService: PushNotificationsNetworkable and more specifically :
self.networkRequest(request, session: self.session) { (response) in
switch response {
case .Success(let data):
guard let device = try? JSONDecoder().decode(Device.self, from: data) else {
return
}
//crashes here
completion(device.id, true)
case .Failure(let data):
guard (try? JSONDecoder().decode(Reason.self, from: data)) != nil else { return }
completion(nil, false)
}
}
the app crash every time (where it is marked "crash here above"). I then get the following message:
1 0x0000000106a0a260 in closure #1 in Pods/PushNotifications/Sources/NetworkService.swift:25
Can you give me any advice?