Skip to content

[Bug] Offline Support For Realtime DB does not work with Unity Android SDK #1090

Open
@saifullah73

Description

@saifullah73

Description

ISSUE

I am trying to enable offline capabilities for Realtime DB on Android, but it does not seem to work. The offline capability works fine on Editor and even though Android seems to have the feature, it doesn't work on it.

Code Used

FirebaseApp firebaseApp = Firebase.FirebaseApp.Create(options, Guid.NewGuid().ToString());			
_realtimeDbInstance = FirebaseDatabase.GetInstance(firebaseApp);
_realtimeDbInstance.SetPersistenceEnabled(true);

Reproducing the issue

On Editor:

Launch the game, turn off internet, change player configs, close the game, relaunch after enabling internet. The updated configs show up

On Android:

Repeat the same steps, but after relaunch, the old configs show up , since they were never written to the firebase realtime db

Firebase Unity SDK Version

12.0.0

Unity editor version

2022.3.22f1

Installation Method

.unitypackage

Problematic Firebase Component(s)

Database

Other Firebase Component(s) in use

Analytics, Authentication, Crashlytics, Firestore, Remote Config

Additional SDKs you are using

UnityIAP, Mirror, PlayGames

Targeted Platform(s)

Apple Platforms, Android

Unity editor platform

Mac, Windows

Scripting Runtime

IL2CPP

Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

Relevant Log Output

No response

If using CocoaPods for Apple platforms, the project's Podfile.lock

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions