[Solved] iOS Error: Cannot convert value of type ‘UserModel’ to expected argument type ‘[String : Any]’

You have to convert your UserModel to [String : Any] type in order to save it on firebase. Try this: func convertUserModelToDictionary(user: UserModel) -> [String : Any] { let userData = [ “name” : user.name, // change these according to you model “email”: user.email, “user_id”: user.userId ] return userData } You can use this function … Read more

[Solved] Upload an image from device to firebase

Well, I don’t know whats going on but, this works for me, Make sure your pods has at least these in there. PODFILE pod ‘Firebase/Storage’ pod ‘Firebase/Auth’ #Auth isn’t needed but, you should really use it. View controller import UIKit import FirebaseStorage class TestView: UIViewController { var imageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() imageView … Read more

[Solved] Ionic5/Angular – Error trying to diff ‘[object Object]’. Only arrays and iterables are allowed

I’d try something like this, As long as the querySnapshot returns array of storedData without any nested objects, you can set it directly if not you have to read it through the correct entry from the response structure and read the values from the list accordingly in your HTML template fetchBookings() { this.afs .collection(‘user’) .doc(this.userId) … Read more

[Solved] How can I add one month to change into the milliseconds?

I suggest: First, instead of your variables (fields?) year, month, day, hours and minutes just declare private LocalDate date; private LocalTime time; private long milliseconds; (Keep the milliseconds variable since you will want to have your result here.) In onDateSet assign a value to date in this way: date = LocalDate.of(selectedYear, selectedMonth + 1, selectedDate); … Read more

[Solved] Fetch all children from database

This answer is similar to a prior answer here What you want to do is to treat each child in Customers as a DataSnapshot, then the children can be accessed. Given a Firebase structure: usersDatabase uid_0 Customers Ben Smith data: “Some data” Tom Cruise data: “Some data” uid_1 Customers Leroy Jenkins data: “Some data” uid_2 … Read more

[Solved] How do I solve this issue? I get this error while building an android project with gradle

To fix this error, you need to add a value for UniqueFirebaseUrl in your gradle.properties file. You should create a file and add a line that looks like this: UniqueFirebaseRootUrl = “https://shoppinglistplspls.firebaseio.com/“ source: https://github.com/udacity/ShoppingListPlusPlus/issues/8 solved How do I solve this issue? I get this error while building an android project with gradle

[Solved] Second If statement gets called before first statement finished in one function

Asynchronous methods! You have to wait for the completion before you move on to the next step. Put the second block within the first completion handler – like this func pictureFromFirebase(loginMethod: Int) { if loginMethod == 0 //FB { var profilePic = FBSDKGraphRequest(graphPath: “me/picture”, parameters: [“height”:300, “width”:300, “redirect”:false], httpMethod: “GET”) let profilePicRef = storageRef.child((user?.uid)!+”/profile_pic.jpg”) profilePicRef.data(withMaxSize: … Read more

[Solved] How can I set the android channel notification from code in firebase cloud function?

Solution: It seems that you can assign the category that you want to relate the message: const message = { android:{ notification:{ title: ‘Game started!’, body: ‘Game ‘+ salaName +’ has started!’, channel_id: “notification.category.default”, } }, topic: “topicName” }; Source: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidfcmoptions 0 solved How can I set the android channel notification from code in firebase … Read more

[Solved] Firebase Query help me

To solve this problem, move the declaration of your final int[] ndomande = {14}; array inside the onDataChange() method, otherwise it will be always null. public void onDataChange(DataSnapshot dataSnapshot) { //Toast.makeText(PlayTest.this, “FIN QUI “,Toast.LENGTH_SHORT).show(); final int[] ndomande = {14}; for (DataSnapshot messageSnapshot : dataSnapshot.getChildren()) { //Toast.makeText(PlayTest.this, “QUI “,Toast.LENGTH_SHORT).show(); long numero_domande = (long) messageSnapshot.getValue(); ndomande[0] = … Read more

[Solved] I keep getting java.lang.String com.google.firebase.auth.FirebaseUser.getUid()’ error although it has already confirmed they is a user

I keep getting java.lang.String com.google.firebase.auth.FirebaseUser.getUid()’ error although it has already confirmed they is a user solved I keep getting java.lang.String com.google.firebase.auth.FirebaseUser.getUid()’ error although it has already confirmed they is a user