So, I am creating this fast application that has data that must be read before a user logs in.
To protect it from reading from my application, I set a basic security rule:
".read": "auth != null"
To prevent reading before entering the system, I installed the download view controller on call:
func application(application: UIApplication, willFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool { let ref = Firebase(url: "<my firebase url>") ref.observeAuthEventWithBlock({ authData in if authData != nil { segueToListViewController() } }) return true }
But when I get to this point, sometimes firebase gives me the error "allowed rejection", sometimes it is not.
I am sure that the registered user, because I register everything:
- Login changed
- User logged in to AuthData facebook:
- applicationDidBecomeActive
- Loaded ListViewController
- Data loading
- Error: Domain Error = com.firebase Code = 1 "Permission denied"
So, why does Firebase sometimes refuse to read when a user logs in?
source share