Hello, I’m having an issue with the save method.
Here’s the object I’m trying to save and the function.
The error completion handler of the save method is showing this error:
Optional(FAULT = ‘Server.Processing’ [exception during method invocation] <exception during method invocation> )
The app ID is “752CC57D-33EE-ADE7-FFC6-06A0D032FE00”
Thanks for the help
class Photo: NSObject {
var objectId: String?
var title: String?
var location: GeoPoint?
var imageUrl: String?
var username: String?
var datetime: Date?
var address: String?
var user: BackendlessUser?
var isVideo: String?
var videoThumbnail: String?
var voiceNoteUrl: String?
}
//Backendless User
▿ Optional<Dictionary<String, Any>>
▿ some : 17 elements
▿ 0 : 2 elements
- key : "name"
- value : Nelson B
▿ 1 : 2 elements
- key : "email"
- value : nelsonb21@gmail.com
▿ 2 : 2 elements
- key : "__meta"
- value : {"relationRemovalIds":{},"selectedProperties":["appVersion","website","created","bio","ownerId","__updated__meta","password","phoneModel","osVersion","name","osType","___class","updated","profileImageUrl","objectId","email"],"relatedObjects":{}}
▿ 3 : 2 elements
- key : "___class"
- value : Users
▿ 4 : 2 elements
- key : "website"
- value : google.com
▿ 5 : 2 elements
- key : "ownerId"
- value : E8E126E4-CCB6-A592-FFE5-F63A35C44100
▿ 6 : 2 elements
- key : "osType"
- value : iOS
▿ 7 : 2 elements
- key : "lastLogin"
- value : 2017-09-05 01:31:00 +0000
▿ 8 : 2 elements
- key : "appVersion"
- value : 1.0.1
▿ 9 : 2 elements
- key : "profileImageUrl"
- value : https://api.backendless.com/1e2a2619-c7dc-8017-ff81-11ea1bc91c00/v1/files/profileImages/E8E126E4CCB6A592FFE5F63A35C44100.png
▿ 10 : 2 elements
- key : "bio"
- value : IOS Developer
▿ 11 : 2 elements
- key : "updated"
- value : 2017-08-13 14:57:49 +0000
▿ 12 : 2 elements
- key : "user-token"
- value : 236623C2-BCD8-DBC9-FFB9-D0EBF5686A00
▿ 13 : 2 elements
- key : "osVersion"
- value : 10.3.3
▿ 14 : 2 elements
- key : "created"
- value : 2016-11-12 19:46:26 +0000
▿ 15 : 2 elements
- key : "phoneModel"
- value : iPhone 6s Plus
▿ 16 : 2 elements
- key : "objectId"
- value : E8E126E4-CCB6-A592-FFE5-F63A35C44100
//Location var value
"Optional(<GeoPoint> LAT:11.00597209173036, LON:-74.81811392779683, distance:0, CATEGORIES:(\n Bubo\n), METADATA:{\n}, objectId = (null))"
//Saving Function
static func savePhotoWithUser(_ photo: Photo, completion: @escaping AppCompletion) {
Backendless.sharedInstance().data.of(Photo.ofClass()).save(photo, response: { response in
debugPrint(response as Any)
completion(true, nil)
return
}, error: { (error) in
debugPrint(error as Any)
completion(false, error)
return
})
}
Hello,
We can’t reproduce this issue.
Could you please upload your project archive (only the part that causes issue: saving + completion) in Google Drive or Dropbox and share it with us (support@backendless.com)?
But it would be really nice if this work as in the previous sdk version, where the relations where part of each class. This way the client only need to do one request, instead of the number of relations it has.
I am totally agree with Nelson’s statement. I think the way the previous sdk version would be better for client side and reduce the code after the one request, and does not need to make more network requests. Please consider way back to old version regarding relation set.