public FirebaseDataStore(FirebaseAuthService authService, string path)
        {
            /*FirebaseOptions options = new FirebaseOptions()
             * {
             *  AuthTokenAsyncFactory = async () => await authService.GetFirebaseAuthToken()
             * };*/

            _query = new FirebaseClient(BaseUrl).Child(path);
        }
Example #2
0
        public FirebaseOfflineDataStore(FirebaseAuthService authService, string path, string key = "")
        {
            FirebaseOptions options = new FirebaseOptions()
            {
                OfflineDatabaseFactory = (t, s) => new OfflineDatabase(t, s),
                AuthTokenAsyncFactory  = async() => await authService.GetFirebaseAuthToken()
            };

            // The offline database filename is named after type T.
            // So, if you have more than one list of type T objects, you need to differentiate it
            // by adding a filename modifier; which is what we're using the "key" parameter for.
            var client = new FirebaseClient(BaseUrl, options);

            _realtimeDb = client
                          .Child(path)
                          .AsRealtimeDatabase <T>(key, "", StreamingOptions.LatestOnly, InitialPullStrategy.MissingOnly, true);
        }
 public DataStoreContainer(FirebaseAuthService firebaseAuthService)
 {
     _firebaseAuthService = firebaseAuthService;
 }