Firebase Authentication does not insert new values - ios

I recently updated to the newest version of Xcode and I've got a lot of problems since then. I've a "Sign up" form where user can create a new account on the app but somehow it does not insert new values into the Authentication.
I commented out my code and just tried to run the normal create user function so my code looks like this right now:
Auth.auth().createUser(withEmail: txtfield_email.text!, password: txtfield_password.text!) { (adr, err) in
if let err = err{
print(err.localizedDescription)
}else{
print("Succeded creating a new user!")
}
}
So when I run the app it will go into the else and print out: "Succeded creating a new user!" but when I login to my Firebase account and check if any new values is added to the authentication the answer is no. Nothing is there.
I've updated all my pods including the Firebase and still does not work.
What could of happen? Why doesn't it run like normal?
Just to mention: I'm currently running it on the simulator (Not my own device). But like I said, nothing new is getting implemented in Authentication. (Everything worked perfectly fine before, but not after I updated...?)

I've been struggling on this for hours and hours. But once I posted this thread I found my solution.
If you find this error yourself the solution is.
Go to your console in Firebase and download the latest version of:
GoogleService-info.plist
And replace your current one with the latest.

Related

swift - Sign in With Apple "Sign Up not completed" error

Made all the setup for sign in with apple, but when pressing on continue and passing Face ID check I am getting "Sign Up not completed" error. However, no error is thrown to the delegate.
Then I tried to create a test project with my friend's Paid developer account and everything was fine, no errors. I haven't connected to the API, just trying to print Email and Fullname.
May be something is wrong with my company's Developer account?
I had the same issue. I did followings and it was working fine.
Go to developer apple and choose app's bundle id
Remove Sign In With Apple and save
Again go to your app's bundle id and add Sign In With Apple and save.
Hope this works!
I had created Auth Key with Apple Sign selected in which is never used. When I remove the unused Auth Key it worked.
I recently encountered this error and the root problem turned out to be some back-end data problem with my Apple account.
I ultimately had to raise an Apple Technical Support Request, generate some debug information for them, and then they ultimately fixed their back-end data for my account. The overall process took just under three weeks.
For me the reason was , I was using my bundle id in the place where Apple services ID should be entered in cognito user pool.
As suggested on this SO thread, this is sometimes an issue one Apple's end. I have tested with Apple's own project from the documentation and ran into the same issue.
I reached out to Apple DTS support and they replied the following:
The underlying issue was unexpected. We have confirmed the issue was
caused by an internal data feed sync operation and was resolved today.
So in my case, the issue went away after 2 days without any changes.
Sometimes, it just takes 2 days on Apple's side to process everything.
Spare yourself the hassle and just wait it out. If you have followed their documentation you did everything right:
https://help.apple.com/xcode/mac/11.0/#/dev50571b902
Just go to your project's signing capabilities, click + and add Sign in with Apple:
Add the SignInWithApple Button:
import AuthenticationServices
...
SignInWithAppleButton(.signUp) { request in
request.requestedScopes = [.fullName, .email]
} onCompletion: { result in
switch result {
case .success(let authResults):
handleSuccess(authorization: authResults)
case .failure(let error):
logger.error("SIWA login failure: \(error)")
}
}
.signInWithAppleButtonStyle(.white)

Facebook authors user.credential returning nil

Hi I am building an iOS app using swift 4.2 and everything works fine. While I am trying to test all scenarios, when I try to connect through Facebook auth, there will be a push message notification saying
“your app” wants to use “Facebook.com” to sign in.
Well if I press continue it work fine but if I press cancel my                     
Let credential = FacebookAuthProvider.credential(withAccessToken:FBSDKAcessToken. Current().tokenString)
is returning nil. I tried to unwrap but it didn’t work. Anyone knows how to fix it please. I appreciate your help.
I found the solution which is to verify that FBSDKAccessToken.current() is not nil before creating the credential variable

Firebase Firestore missing or insufficient permissions using Expo (React Native)

I've been using FireStore for a project that works fine in the browser, but when I port the code to Expo, running on a iOS 11.2 iPhone X in the simulator, it keeps raising Error: Missing or insufficient permissions.
Auth is working fine, and when I check the client in the Firestore collection object, the appropriate UID is set, and testing the same code in the browser, everything works perfectly (no permissions problem). What I'm trying to say is that I'm 95% certain that the issue is with the Firebase lib/react native/expo combination, rather than with my code. Especially since it seems that making a call to Firestore in the browser, there are headers set, but when debugging the call in Reactotron (from Expo), it looks like the call the Firebase lib is making has no headers at all.
I doubt it makes a difference, but here are my auth rules:
service cloud.firestore {
match /databases/{database}/documents {
match /UserData/{userID} {
allow read, write: if request.auth.uid == userID;
}
match /MemberData/{userID} {
allow read: if request.auth.uid == userID;
}
}
}
The call I was trying to make (and there is definitely data in the doc) is the following:
profile = (await UserDataCollection.doc(`${idToken.uid}`).get()).data();
I'm curious if anyone else has run into this problem, and if so, are there any workarounds to make Firestore work?
As per previous comments, downgrading to 4.6.2 seems to fix the issue. I'm not sure the exact root cause but the behaviour of how the auth headers are sent seem to have changed (so potentially something there?). I'll update my answer if I get time to investigate further. Happy for one of the Firebase team to contact me for my account details if they want to verify on their side.

iOS Facebook Account kit - Persist user token when app is opened 2nd time after successful login

My doubt is after successful login using Facebook account kit for the first time, I am reopening the app for the 2nd time. When I open how can I detect and use the existing user Access Token?
I tried by fetching Accountkit.currentAccessToken in appdelegate as a condition to show login page or welcome page. But currentAccessToken returns me null.
I have also enabled "Enable Client Access Token Flow" in app settings.
Kindly help to understand if my approach is right.
self.accountKit = AKFAccountKit (responseType: AKFResponseType.accessToken)
if(self.accountKit.currentAccessToken != nil)
{
//SHOW WELCOME PAGE
}else{
//SHOW LOGIN PAGE
}
I am facing the same issue in Android (not in iOS) but I think the problem is same, since in the document says it so.
this is my code for configuring the login using Email (kotlin, use let to change the val).
val configurationBuilder = AccountKitConfiguration.AccountKitConfigurationBuilder(
LoginType.EMAIL,
AccountKitActivity.ResponseType.CODE)
notice that the response type is AccountKitActivity.ResponseType.CODE
In the document says:
If you began the login session with AccountKitActivity.ResponseType.TOKEN, a logout option is available to remove the stored AccessToken from the device.
So the problem is on the Response type that I use, need to be changed into AccountKitActivity.ResponseType.TOKEN in order to make the token stored on devices.
I have seen some issues with Xcode8 / iOS 10 Simulators and keychain save/retrieval. See https://forums.developer.apple.com/thread/60617
AccountKit stores the accessToken securely in the keychain but there is an intermittent bug on Xcode8 / iOS 10 Simulators that makes read/write from keychain fail.
Can you test if this is also happening on a Device?
Apparently the problem goes away if you add the Shared Keychain Entitlement to your App, but this is still a bug on Apple.

"There are no Facebook accounts configured" error message on iOS when use IS logged in via Settings - app built with Corona SDK

One of our users is getting the following error when they try to post from the native popup:
No Facebook account.
There are no Facebook accounts configured. You can add or create a Facebook account in Settings.
However they assure me that they are signed into Facebook via Settings, and they are still able to post from one of our other apps. All other test users can post directly without any issues, and afaik it worked in the past in this app for the user who is currently experiencing problems.
It seems like it's most likely an OS issue rather than an issue in my code, I simply request that the native popup be shown and pass an image and some text through (these are still being pushed to the native popup correctly):
if native.canShowPopup( "social", "facebook" ) and system.getInfo("platformName") ~= "Android" then
local function socialFBListener(e)
if e.action == "sent" then
print("FB post sent successfully")
end
end
local options = {
service = "facebook",
message = "Here is some testing text",
listener = socialFBListener,
image = {
{ filename = "testImage.jpg", baseDir = system.DocumentsDirectory },
},
url = "http://quixtix.co",
}
native.showPopup( "social", options )
end
I can't find any reference to anyone receiving this error when they are signed in, all links I could find simply tell you how to sign in.
Error was due to a fault on the user's device. After updating iOS and restarting the device the problem went away.
I have the same problem. But its due to I was forgot to set my app as
'Public'
it can be done by,
Goto https://developers.facebook.com -> App Review
Set Make 'appName' public? to YES.
For anyone who are struggling with this issue at the moment, the solutions are worked out like this:
Delete the Facebook account at iOS "Settings".
Try to connect with your Facebook account at your app again.
Get success
Add the Facebook account back to iOS "Settings" again if you'd like.
Cheers.

Resources