Example #1
0
 /// <summary>
 /// Clean up using cloud function. Also delete and create the super user.
 /// </summary>
 private async Task SetUpFirestoreForTest(bool recreateUser)
 {
     var ff          = FirebaseFunctions.GetInstance(Firestorm.AuthInstance.App);
     var testCleanUp = ff.GetHttpsCallable("firestormTestCleanUp");
     var callResult  = await testCleanUp.CallAsync(new Dictionary <string, object>
     {
         ["recreateUser"]      = recreateUser,
         ["testSecret"]        = FirestormConfig.Instance.testSecret,
         ["superUserId"]       = FirestormConfig.Instance.superUserEmail,
         ["superUserPassword"] = FirestormConfig.Instance.superUserPassword,
     });
 }
Example #2
0
        public async Task AddNotification(Models.Notification newNotif, string functionCall)
        {
            TaskCompletionListener taskCompletionListener = new TaskCompletionListener();
            var app = FirebaseApp.InitializeApp(_context);

            firebaseFunc = FirebaseFunctions.GetInstance(app);

            var func = firebaseFunc.GetHttpsCallable(functionCall)
                       .Call(JsonConvert.SerializeObject(newNotif))
                       .AddOnSuccessListener(_activity, taskCompletionListener);

            taskCompletionListener.Succes  += TaskCompletionListener_Succes;
            taskCompletionListener.Failure += TaskCompletionListener_Failure;
        }
 public FirebaseService()
 {
     auth      = FirebaseAuth.DefaultInstance;
     functions = FirebaseFunctions.GetInstance("asia-northeast1");
 }