Hello,
Im using the .NET SDK with Unity, I want to “prepopulate” the realm database, copy it into the Ressouces Folder, so I can load the Database at the first startup on the Android device.
I got this working inside the unity editor, however it does not work on Android.
string databasePath = Path.Combine(Application.persistentDataPath, databaseFileName);
if (!File.Exists(databasePath))
{
// If the database doesn't exist, copy the prepopulated database from Assets
TextAsset prepopulatedDatabase = Resources.Load<TextAsset>(defaultName);
if (prepopulatedDatabase != null)
{
File.WriteAllBytes(databasePath, prepopulatedDatabase.bytes);
Its using the correct path, but after Realm.GetInstance();
I cannot find any Data created before.
Any solution or workaround to deliver a Database that is already filled with Data on the first startup?
Thanks!