0

I'm making a library that uses realm to save data. I set up modules (one for the library and one for the app) and I'm using the realms with the different configs with the modules.

Does the user have to know my RealmObject's names to avoid calling its classes the same way? If I do, Realm crashes. Or is there a way to avoid the crash even if the user calls its models the same as my library's? If so, how? I've tried with different Module configurations but without luck.

lebelinoz
  • 4,890
  • 10
  • 33
  • 56
alessandro gaboardi
  • 889
  • 3
  • 11
  • 26

1 Answers1

1

Unfortunately, yes at the moment. Realm does not use the package name for model classes as this do not translate well to other platforms.

Right now the best option would be to prefix your library model classes with something that has a very low probability of conflicting with people using the library.

Christian Melchior
  • 19,978
  • 5
  • 62
  • 53
  • Yes that's what i ended up doing, it would be cool if different Modules (or something else) separated the RealmObjects even if with the same names, so that it's impossible for the user to crash the app by using the same names – alessandro gaboardi Sep 18 '17 at 08:26