Comments (9)
Sorry, I don't have any experience with this kind of Sign in with Apple -> Firebase integration.
The common behavior with this plug-in people stumble upon is that the name is only provided for the initial sign-up (let's call it registration), and must then be stored in ones own data storage.
From previous experience I know that the "default" Firebase SiwA integration does indeed save the user's name on their user object. Is it possible that you had different code running on the first login (= registration)? If so, try disassociating your Apple ID from the app and register anew.
from dart_packages.
Sorry, I don't have any experience with this kind of Sign in with Apple -> Firebase integration.
The common behavior with this plug-in people stumble upon is that the name is only provided for the initial sign-up (let's call it registration), and must then be stored in ones own data storage. From previous experience I know that the "default" Firebase SiwA integration does indeed save the user's name on their user object. Is it possible that you had different code running on the first login (= registration)? If so, try disassociating your Apple ID from the app and register anew.
No I am not using any other code for registering the user.
from dart_packages.
It may be a Firebase's problem. I used FirebaseAuth before and was unable to obtain the user's email address, whether it was real or anonymous. I gave feedback to Firebase, and they replied that they are currently investigating the issue
from dart_packages.
It may be a Firebase's problem. I used FirebaseAuth before and was unable to obtain the user's email address, whether it was real or anonymous. I gave feedback to Firebase, and they replied that they are currently investigating the issue
please let me know if you find any solution regarding this issue thanks.
from dart_packages.
Same problem here.
I use the following the snippets
final AppleAuthProvider appleProvider = AppleAuthProvider().addScope('name'); cred = await FirebaseAuth.instance.signInWithProvider(appleProvider);
and
`try {
final appleCredential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.fullName,
AppleIDAuthorizationScopes.email
],
);
// Create an OAuthCredential
from the credential returned by Apple.
final oauthCredential = OAuthProvider("apple.com").credential(
idToken: appleCredential.identityToken,
);
final UserCredential cred =
await FirebaseAuth.instance.signInWithCredential(oauthCredential);
if (cred.user?.displayName == null ||
(cred.user?.displayName != null && cred.user!.displayName!.isEmpty)) {
final fixDisplayNameFromApple = [
appleCredential.givenName ?? '',
appleCredential.familyName ?? '',
].join(' ').trim();
await cred.user?.updateDisplayName(fixDisplayNameFromApple);
}`
For both of them i don't get any "name" or "email" (email only requested in the second though).
Already read, that it is only send at the first login attempt. Deleted userdata from DB, followed this instruction and nothing seems to work...
Very frustrating, my app gets declined by apple due to this..
Contacted Firebase and Apple support asking for help. If I'll find a solution i let you guys know.
Another problem seems to be that i don't even get shown this form
![image](https://private-user-images.githubusercontent.com/89179997/332392402-3b304838-7c7d-446b-ba48-c726abcfee64.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxODMwNjcsIm5iZiI6MTcxOTE4Mjc2NywicGF0aCI6Ii84OTE3OTk5Ny8zMzIzOTI0MDItM2IzMDQ4MzgtN2M3ZC00NDZiLWJhNDgtYzcyNmFiY2ZlZTY0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIzVDIyNDYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1OTYzN2I1NWZiYWEwODg4M2RkZGYxNzU3NDU5N2UwYTdhM2M1MmIxNTRjNWQ3OWRkMTk3OTNkZDFiNjlmM2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.auMvPr2xBPk83mVn7PaxpKf1K3FTHNT5Zhs2NUNzGI4)
For me it looks always like this
Not been asked for any email or name, anybody know why it is like that?
from dart_packages.
In the end, this seemed to work for me
if (cred.user?.displayName == null || (cred.user?.displayName != null && cred.user!.displayName!.isEmpty)) { final fixDisplayNameFromApple = [ appleCredential.givenName ?? '', appleCredential.familyName ?? '', ].join(' ').trim(); await cred.user?.updateDisplayName(fixDisplayNameFromApple); }
seems like it doesn't work on ios 17.5 however though. 17.4 and lower is working
from dart_packages.
@hajiboy95 some people have reported that on different other platforms that App Store is rejection applications with this solution can someone please confirm this ? and also can u send me complete code how are u managing first time sign in and second sign in in this case ?
from dart_packages.
So in the end it worked quite easy for me. Now I have:
Future<void> signInWithApple() async {
try {
final AppleAuthProvider appleProvider =
AppleAuthProvider().addScope('name');
cred = await FirebaseAuth.instance.signInWithProvider(appleProvider);
await getUserData();
} catch (error) {
SnackBar(content: Text('Error signing in with Apple: $error'));
debugPrint('Error signing in with Apple: $error');
// Handle the error as needed in your application
}
}
where the getUserData() method is
Future<void> getUserData() async {
if (currentUser != null) {
uData = await userDataRepository().getByID(currentUser!.uid);
uData ??= userData(
id: currentUser!.uid,
name: cred?.user?.displayName,
profile_picture_url: cred?.user?.photoURL,
creation_date: cred?.user?.metadata.creationTime);
} else {
uData = null;
}
}
later on i use the uData for filling in the form.
If apple complains i guess i'll just write a mail to them. so far it worked a few times to hand in my app (i didn't launched it yet, still in testing. but just sendet it a few times to apple to see whether they'll accept my method or not)
from dart_packages.
I was facing the same problem with FirebaseAuth
. The displayName
was always null
here is how you can fix it.
Future<UserModel?> _signInWithCredential(OAuthCredential oauthCredential, {String? userName, String? email, required String socialType}) async {
try {
final userCredential = await FirebaseAuth.instance.signInWithCredential(oauthCredential);
final authUser = userCredential.user;
if (authUser != null) {
await authUser.updateProfile(displayName: userName,);
await authUser.reload();
final updatedUser = FirebaseAuth.instance.currentUser;
return UserModel(
social_id: updatedUser?.uid ?? authUser.uid,
email: email ?? authUser.email,
socialType: socialType,
deviceToken: "No Device Token",
name: updatedUser?.displayName ?? userName,
);
}else{
return null;
}
} catch (e, s) {
blocLog(msg: 'Sign-in with credential error: $e', bloc: "AuthServices", exp: s.toString());
return null;
}
}
from dart_packages.
Related Issues (20)
- [SIGN_IN_WITH_APPLE]"Cannot Complete Request" Error after Clicking "Continue", Flutter Web HOT 1
- <data> tag failed HOT 3
- SSO with Apple in Flutter web not working
- SSO Apple sing in with firebase show Error Continue button not working , Flutter Web
- Apple delete account HOT 1
- sign_in_with_apple ^5.0.0 is forbidden HOT 1
- sign_in_with_apple: Migrate to `package:web` to support WASM HOT 6
- sign_in_with_apple: getCredentialState always returns authorized HOT 3
- Fix deprecation warnings
- Update dependencies (js) in sign_in_with_apple_web HOT 1
- iOS - Apple login not getting correct email and after successful login nothing happens HOT 2
- sign_in_with_apple web: TypeError when the sign in flow completes in version 6.0.0, works in 5.0.0 HOT 7
- I hope to add an option to remove Android dependencies, as Apple login is generally not needed on Android devices. HOT 4
- Add iOS privacy manifests HOT 4
- [sign_in_with_apple] Add privacy manifest file for iOS HOT 1
- Cannot find symbol ... sign_in_with_apple.SignInWithApplePlugin() HOT 6
- The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher. HOT 6
- userIdentifier is null on web HOT 4
- Remove references to deprecated v1 Android embedding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart_packages.