I install Firebase in my iOS app. Everything works fine on simulator but on real device it doesn't execute / return a query to my database.
I try to clean the project but it doesn't change anything.
Have you a solution ?
EDIT : Update with code
override func viewDidLoad() {
super.viewDidLoad()
// Setup Firebase
self.ref = FIRDatabase.database().reference()
self.ref.child("Database").observeEventType(.Value, withBlock: { (snapshot) in
if snapshot.exists() {
for rest in snapshot.children.allObjects as! [FIRDataSnapshot] {
print(rest.value)
}
} else {
}
}) { (error) in
print(error.localizedDescription)
}
}
There is no fault in your code, I had the same problem. Here is what I did:
Simply go to Your Project in the navigation pane on the left.
Go to Build Settings and scroll down to Build Options.
Change the value of Enable Bitcode to No.
Hope it works out for you too!
I found that if you logged in, and delete the application, then after you install the application again, you will still be logged in. I do not know exactly, but I assumed that Firebase somehow binds the account cache to the Bundle Identifier, not in the local storage.
So the solution is simple and it worked for me:
Update: Firebase remembers your login in the keychain
Update: Firebase remembers your data in keychain using your Bundle identifier as key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With