Hi, I am using backendless_sdk: ^1.1.2
I am trying to create new record on BLUser Table. But save function does not work on iOS, its working well on Android.
Nothing happen when I call
response = await backendless.Backendless.data.of(Constants.BLUSER_TABLE).save(user.toJson());
it stuck forever at that line.
In Android, its working well, the response is:
We checked it out, followed the steps you specified and the object saved successfully. Can you please provide the full code sample you use to create a new record on BLUser table?
Please also check if you ever reach the save function on iOS. I have the assumption that it’s never called and therefore object is never saved. Because the Backendless.data.of(table).save() method works correctly for both Android and iOS.
Here my code:
Map user = {
“objectId”: userBLId
};
int result = -1;
try {
result = await backendless.Backendless.data.of(Constants.BLUSER_TABLE).setRelation(user, "location:GeoPoint:1", children: [savedLocation]);
} catch (exception) {
Log.show(TAG, "updateBLUserLocation failed " + exception.toString());
return Future.error(exception);
}
In Android, it worked fine and return result = 1;
In iOS it stuck forever at this line result = await backendless.Backendless.data.of(Constants.BLUSER_TABLE).setRelation(user, "location:GeoPoint:1", children: [savedLocation]);
I resolved by pass saved location as a Map: savedLocation.toJson()
Now it work fine on both Android & iOS. Thanks
result = await backendless.Backendless.data
.withClass()
.setRelation(user, “location:GeoPoint:1”, children: [savedLocation.toJson()]);
We updated relations method signatures and published Flutter SDK v.1.1.5. Now you can just use parent and child object IDs instead of the objects itself.