Data collection problem

I am trying to use backendless so that the user does not depend on calbacks to be able to have the most current data, that is, not to store states but to keep the data updated. For this I am trying with data collections, which is a feature that I understand is included in the framework.

I have followed backendless data collection tutorial, and also I downloaded example project with it. I’m trying to use backendless data collection feature. That i want is to iterate over tables and retrieve data as appears in the tutorial.

This is tutorial: Backendless Data Collection Tutorial for iOS (Updated) | Backendless
This is code example: GitHub - olgadanylova/BackendlessDataCollectionSample: Sample project that demonstrates usage of the BackendlessDataCollection class binded to UITableView

To test the project you only need the following:

  1. Set api-key, app-id in AppDelegate file
  2. Run app and try to insert records

Expected Behavior

  1. The user creates a new record
  2. Data is storaged in backendless (Using data collection object)
  3. Data is retrieved to UI

Actual Behavior

  1. The user creates (apparently) a new record
  2. Data doesn’t store in backend (Person object is created, but Data collection doesn’t have records after insertion)

I put several breakpoints in class initializers, methods to insert or add records etc, inside the helper class of the data collection, but it doesn’t even stop at any point.

In case you have a suggestion regarding this solution, I am open to hearing it. What I need to achieve is an implementation that from the frontend does not depend on the objectids for updating and manipulation of the data.

Greetings!!

Hello @Lenin_Cabrera ,

Welcome to our community and thank you for trying out Backendless

do you use the example from github as is, or have you changed something, except credentials?

Hello @Lenin_Cabrera,

Please change the Identifiable protocol to BLIdentifiable here:

import Backendless

@objcMembers class Person: NSObject, Identifiable {
    var objectId: String?
    var name: String?
}

Regards,
Olha

Hi @olhadanylova, thanks for answering. I did the change, and now i have:

import Backendless

@objcMembers class Person: NSObject, BLIdentifiable {
    var objectId: String?
    var name: String?
}

After this change the app is fetching stored data in backendless from testing table, and all interruption points are working fine, so far all good, but when i try to create new record, the record is created in BackendlessDataCollection (that is, only in frontend) but it doesn’t created on backendless… any idea what is happening?

@sergey.kuk I have no other changes other than that

@Lenin_Cabrera
to save the item you should take the item and save it as any other object, check out the following doc Saving Single Object - Backendless SDK for iOS API Documentation

Also, I have created an internal ticket BKNDLSS-26677 to change the samle to show how to store the data on the server, but I can not say when it will be ready. We will let you know when it will be ready

Hello @Lenin_Cabrera,

BackendlessDataCollection sample was updated and now supports data synchronisation with Backendless.

Regards,
Olha