how to send data from realm to backendless?

i am using ios sdk and realm.io database . When i’m trying to send data to backendless, debugger write that there is now table like myTable_Realm … , how i can send data to backendless ?

Hope these docs will be helpful for you:

Also you could use our BlogFeatureDay sample projects, this for example.

Hello Vyacheslav! Thank you, i saw these links , i know how to save objects to backendless. I want to know how to save Realm classes to backendless?

I can load from backendless, but can’t save to backendless

Could you provide small example?

Here is the success report:http://intellection.kz/blog/чем-мы-заменили-parse/

Alexandr, you wrote: “I can load from backendless, but can’t save to backendless”

Why? Do you receive some fault? What? Could you provide some screenshots?

We need to reproduce the issue, but we have not a sample project with Realm. Could you send your project to support@backendless.com, we will investigate it and find the solution for you.

Regards,
Slava

I’ve attached 3 screenshots, where i’ve declare class Order inheritable from class Object (base clase for Realm objects) , function of send order and screenshot of error
And in the same time i can get Order table from backendless to this class without any problem

Screenshot at июля 21 02-20-52.png

Screenshot at июля 21 02-21-05.png

thank you, i’ve read this story earlier , but as i can see not only I have the similar problem:

http://support.backendless.com/t/how-do-you-structure-save-a-realm-object-to-backendless

Please provide your appId here or to support@backendless.com

my app id is A3B37778-DE8A-166E-FFA1-4EFC814F7700

Above i’ve attached wrong screenshot with function ‘sendOrder’ (from other class ‘Orders’) , now i attached correct screenshot with function that not work (class Order)

In my appid in backendless i’ve delete class Order from database , but if it needs i can create this table

Screenshot at июля 21 18-44-50.png

If screenshots is not enough to reproduce, please tell me, because my project is complex and i need some time make simple project that produce issue

Yes, if you can, please make a some simple project (maybe without UI) which demonstrates the problem.

I’ve send mail to support@backendless.com with link to project (121 mb cannot attach to mail)) , mail subject is “app with reproducing error”

You could use pod ‘Backendless’ (without MediaService) - this dramatically reduces the project volume.

ok , understood . Could you reproduce error ?

Hi Alexandr,

Yes, we have reproduced the problem.

The solution is in our sample project.

I fixed ‘objectId’ property of your test class - it MUST BE declared as optional:

 dynamic var objectId: String?

By design Backendless PersistenceService (Data) creates the table with a class name of a saved object. But the objects which are inherited from Realm’s Object class have a specific feature: its class name is added with some prefix, for example, code

 let testExample = test()
 let className = NSString(UTF8String: class_getName(testExample.ofClass()))
 print("!!!!! --> testExample class = \(className) <-- !!!!!!")

shows a log:
http://support.backendless.com/public/attachments/9544bd57dc548378cbaed4fdf269b1a1.png&lt;/img&gt;
Charles also demonstrates RLMUnmanaged_test as a class name of a saving object:
http://support.backendless.com/public/attachments/c8c668196f2fd218c2746452966f3450.png&lt;/img&gt;

and then RLMUnmanaged_test table is created in app:
http://support.backendless.com/public/attachments/532ae77b63d62f51303e12f5aa8ec8f5.png&lt;/img&gt;
We don’t know, if this prefix addition may be switch off, so in our sample project we used the Backendless ‘table to class mapping’ feature. We added in AppDelegate:

 Backendless.sharedInstance().data.mapTableToClass("test", type: Types.sharedInstance().classByName("RLMUnmanaged_test"))
 print("ADD mapTableToClass: \(Types.sharedInstance().getClientClassForServerType("RLMUnmanaged_test")) -> = RLMUnmanaged_test")

and now object is saved in ‘test’ table:
http://support.backendless.com/public/attachments/170f998a5c7a2f4ca50d9b0e7b077886.png&lt;/img&gt;

So, you could use this mapping feature in your project for your Realm data model classes.

Regards,
Slava

Thank you very much! It works! :smiley: I am happy)))
Could you say: even in your last screenshot you have the new columns ‘invalidated’ and ‘className’ , what is it ? Why it was created ? Because these columns also were created in my case too

These are Realm’s Object class public properties. So, they will be in every table of class, which is inherited from Object class. C’est la vie.

Thank you again :)))