Error when saving location code=500


#1

Error when saving location: Optional(Error Domain=ESTRequestBaseErrorDomain Code=500 “Estimote Cloud failed to handle request.” UserInfo={NSLocalizedDescription=Estimote Cloud failed to handle request., NSLocalizedRecoverySuggestion=Check reason field to verify what kind of error happened.})

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    let locationBuilder = EILLocationBuilder()
    locationBuilder.setLocationName("Estimote's Mars office")
    locationBuilder.setLocationBoundaryPoints([
        EILPoint(x: 0.00, y: 0.00),
        EILPoint(x: 0.00, y: 9.85),
        EILPoint(x: 4.56, y: 9.85),
        EILPoint(x: 4.56, y: 0.00)])
    locationBuilder.addBeacon(withIdentifier: "B1",
                              atBoundarySegmentIndex: 0, inDistance: 3.5, from: .leftSide)
    locationBuilder.addBeacon(withIdentifier: "B2",
                              atBoundarySegmentIndex: 1, inDistance: 1.1, from: .rightSide)
    locationBuilder.addBeacon(withIdentifier: "B3",
                              atBoundarySegmentIndex: 2, inDistance: 5.7, from: .leftSide)
    locationBuilder.addBeacon(withIdentifier: "B4",
                              atBoundarySegmentIndex: 3, inDistance: 2.4, from: .rightSide)
    locationBuilder.setLocationOrientation(173)
    let location = locationBuilder.build()
    
    ESTConfig.setupAppID("  ", andAppToken: " ")
    let addLocationRequest = EILRequestAddLocation(location: location!)
    
    addLocationRequest.sendRequest { (location, error) in
        if error != nil {
            print("Error when saving location: \(String(describing: error))")
        } else {
            print("Location saved successfully: \(String(describing: location?.identifier))")
        }
    }
    
    return true
}