tomgilder / flutter_apple_sign_in Goto Github PK
View Code? Open in Web Editor NEWFlutter Plugin for Sign In with Apple
License: MIT License
Flutter Plugin for Sign In with Apple
License: MIT License
All the properties within authorizationResult.credential.fullName returns null when I "reask" user for consent (without removing from Apple ID logins).
Is this the expected behaviour?
Hi,
My app fails to build after adding apple_sign_in: ^0.1.0 dependency. Here is the error list I get. Any idea? Thanks
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
In file included from /Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/AuthorizationControllerDelegate.m:4:
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/Converters/CredentialConverter.h:8:51: error: expected a type
+ (NSDictionary*)dictionaryFromAppleIDCredential:(ASAuthorizationAppleIDCredential*)credential API_AVAILABLE(ios(13.0));
^
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/Converters/CredentialConverter.h:9:40: error: expected a type
+ (NSString*)stringForCredentialState:(ASAuthorizationAppleIDProviderCredentialState)credentialState API_AVAILABLE(ios(13.0));
^
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/AuthorizationControllerDelegate.m:18:34: error: expected a type
- (void)authorizationController:(ASAuthorizationController *)controller
^
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/AuthorizationControllerDelegate.m:19:34: error: expected a type
didCompleteWithAuthorization:(ASAuthorization *)authorization API_AVAILABLE(ios(13.0)) {
^
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/AuthorizationControllerDelegate.m:28:34: error: expected a type
- (void)authorizationController:(ASAuthorizationController *)controller
^
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/AuthorizationControllerDelegate.m:20:24: error: property 'credential' not found on object of type '__strong id'
if ([authorization.credential isKindOfClass:[ASAuthorizationAppleIDCredential class]]) {
/Users/ikramy/dev/flutter/.pub-cache/hosted/pub.dartlang.org/apple_sign_in-0.1.0/ios/Classes/AuthorizationControllerDelegate.m:21:88: error: property 'credential' not found on object of type '__strong id'
_completion([CredentialConverter dictionaryFromAppleIDCredential:authorization.credential]);
^
7 errors generated.
Could not build the application for the simulator.
It worked fine before. Now return result authorized but fillname and email is null
when use hide my email get appleIdCredential.email email null
appleIdCredential.email working good
but when choose hide i can't get hide one to forward to !!!!!
This lib does not support getting user photo url, but Apple ID account assumes photo picture. Does any way to fetch user photo exist?
The problem is that apple is rejecting all new macOS apps, which doesn't support Apple Sign In (if they use Google Sign In, Facebook Sign In). Right now it's impossible to publish an app to macOS AppStore (written in Flutter) because of this issue.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
Please provide any solution I am stuck in the live project.
Hi,
This was the problem,
I was created an app with the help of flutter_apple_sign_in by integrating the apple sign in. all the debug builds are working properly. and the last time I was build the production release and trying to click the button, I can't get the clickable action on the sign in with apple button.
plz hlp me
Unable to build plugin frameworks: 2020-07-17 11:58:33.049 xcodebuild[47850:353722] DTDeviceKit: deviceType from 00008020-000431E83EEA002E was NULL
2020-07-17 11:58:33.187 xcodebuild[47850:353721] DTDeviceKit: deviceType from 00008020-000431E83EEA002E was NULL
** BUILD FAILED **
The following build commands failed:
Ld /Users/wmh/Documents/joyrun/joyrun-fitness/.ios/Fitness/Flutter/Release/iphoneos/Pods.build/Release-iphoneos/apple_sign_in.build/Objects-normal/armv7/Binary/apple_sign_in normal armv7
(1 failure)
Would it be need to add the ability to pass your own TextStyle to the Button? Like so:
AppleSignInButton(
textStyle: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w500,
letterSpacing: .3,
wordSpacing: -.5,
color: Colors.white,
)
Also I think this would help to resolve a part of this issue as well: #30
Your app uses Sign in with Apple as a login option but does not use Sign in with Apple button design, branding and/or user interface elements appropriately as described in the Sign in With Apple Human Interface Guidelines.
Hello guys,
when I sign in into the example, close the App and restart it, I always getting this error code:
2019-10-30 20:02:45.012873+0100 Runner[76206:1907400] [core] Credential State request returned with error: Error Domain=AKAuthenticationError Code=-7001 "(null)"
2019-10-30 20:02:45.107926+0100 Runner[76206:1907406] flutter: getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
`[✓] Flutter (Channel master, v1.10.15-pre.285, on Mac OS X 10.15 19A602, locale de-DE)
• Flutter version 1.10.15-pre.285 at /Users/pedrolopes/Documents/workspace/flutter
• Framework revision 38f2d27685 (2 hours ago), 2019-10-28 11:28:09 -0700
• Engine revision 869b74eb4e
• Dart version 2.6.0 (build 2.6.0-dev.8.2 5b7c981086)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/pedrolopes/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.8.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] VS Code (version 1.39.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
`
@tomgilder Do you have any idea?
The build in Apple button lacks support for other languages than english.
Also it could be very nice to have methods like:
getTextForAppleSignInButton()
getLogoPathForAppleButton()
The users would then be apple to follow the guidelines, but still make smaller adjustments to the button.
EDIT: I think the approach above will fix the following issues as well:
#30
#38
#39
Then the button you include is totally standard, and for everything else refer to the above two methods, so the developers can build the button themselves.
Hi and thanks for your work!
To test the possibility of using the package, I cloned the repository and tried to start it from the example
folder. For this (as written in the instructions) I opened Xcode and check enabled "Sign In with Apple" capability for all build targets and changed signing account to my own.
The application started without problems, the signing in procedure works without problems, but when it comes to login state check, it fails. I think it might be connected with #7, cause i have the same error:
flutter: getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
My flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.17.0-3.4.pre, on Mac OS X 10.15.4 19E287, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[!] Android Studio (not installed)
[✓] VS Code (version 1.45.0)
[✓] Connected device (1 available)
You can't offer apple sign in only on iOS, because people switch from iPhones to Android over the years. So, it's mandatory that your Android apps implement Apple Sign in. And since this is a plugin for flutter, its quite anti-flutter and incomplete to only add the logic for iOS.
In order to be the community adopted library for apple sign in, it's going to have to support Android. The logic for doing so is already done here: https://github.com/willowtreeapps/sign-in-with-apple-button-android .
I'm not sure if it's easiest to add it to this one, or to create new flutter plugin that has the complete solution.
I hope this sign in button allows key field to be set. This will help me writing automated tests with scenarios requiring this button. Thanls
When I try to login on Simulator this happens:
MissingPluginException(No implementation found for method isAvailable on channel dev.gilder.tom/apple_sign_in)
Error trying -> final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);
2019-12-30 18:40:46.796195-0300 Runner[89962:599664] [core] Authorization failed: Error Domain=AKAuthenticationError Code=-7026 "(null)" UserInfo={AKClientBundleID=br.com.enterprise.vbbritodepaulo}
2019-12-30 18:40:46.826946-0300 Runner[89962:599596] flutter: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
Hi,
I have the following code that isn't working fully.
import 'package:http/http.dart' as http ;
class SigninButton extends StatelessWidget {
Widget build(context) {
return FlatButton(
...
onPressed: () async {
final AuthorizationResult auth = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email,
Scope.fullName])
]);
http.Response response = await http.post(url,
body: { "apple_id": auth.credentials.user });
// The following code does not trigger with the above POST request.
// However, if I comment out the POST request, it will.
await showDialog<bool>(context: context,
builder: (context) {
return AlertDialog(
title: Text("Response"),
content: Text("something, something"),
);
}) ;
}
);
}
}
For the life of me I can't figure out why this is so. Not sure how the apple sign in flow, triggered using method channels, works.
Any help / insight / suggestions would be much appreciated.
Thanks
Abhinav.
I was able to use this medium post (https://medium.com/@karlwhiteprivate/flutter-firebase-sign-in-with-apple-c99967df142f) to login my user. How do I log out a user who has signed in with Apple Sign in?
This issue is same as #22, but bit different.
This is SDK version and Xcode version
iPhoneOS13.2.sdk - iOS 13.2 (iphoneos13.2)
Xcode 11.2.1
Please help me!!!
Hello,
The identityToken
in the credential
would be in Uint8List. How do I convert this to a JWT string so that I could use it in my backend server for verification?
Thanks
I need to get the real email to connect with my user, but I’m getting only the private email even if I selecting the real email
Code:
try {
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email])
]);
switch (result.status) {
case AuthorizationStatus.authorized:
AppleIdCredential appleCredential = result.credential;
OAuthProvider oAuthProvider =
new OAuthProvider(providerId: "apple.com");
final AuthCredential credential = oAuthProvider.getCredential(
idToken: String.fromCharCodes(appleCredential.identityToken),
accessToken: String.fromCharCodes(appleCredential.authorizationCode),
);
AuthResult authResult = await _auth.signInWithCredential(credential);
user = authResult.user;
await _getUserByEmail(context, user.email);
break;
case AuthorizationStatus.error:
print("Sign in failed: ${result.error.localizedDescription}");
break;
case AuthorizationStatus.cancelled:
print('User cancelled');
break;
}
} catch (e) {
PlatformException error = e;
debugPrint(" bug tamir: ${error.message}");
}
}
I am using flutter with https://pub.dev/packages/apple_sign_in package for logging in with Apple.
I was able to publish the earlier version of the app with apple_sign_in
but now I am not being able to archive the Xcode Project for publishing.
Note: I can still build the app and app runs but It does build when archiving.and throws the error saying
Module 'apple_sign_in' not found
I have also created a Stackoverflow question in case it's a mistake from my side and is not intended for duplicated attention.
https://stackoverflow.com/questions/60575077/module-apple-sign-in-not-found
After migrating project to swift the apple_sign_in stoped working and gives the error below:
Sign in failed: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
Hi,
Getting following exception when trying to login with Apple after providing the Apple ID password.
flutter: error PlatformException(ERROR_INVALID_CREDENTIAL, The audience in ID Token [abc.def.app] does not match the expected audience abc.def.app., null)
Hi. Thanks for the plugin.
I have an issues including it into my project.
I tried even on newly created flutter project but it does not work.
Steps to reproduce:
pubspec.yaml
from example
into new projectlib
contents from example
into new projectios
folder from example
project into newly created. But this looks pretty hacky.Maybe I'm missing something in setup process?
Hi there,
From Apple
**4. Design: Preamble**
Guideline 4.0 - Design
- Your app uses Sign in with Apple as a login option but does not use Sign in with Apple button design, branding and/or user interface elements appropriately as described in the Sign in With Apple Human Interface Guidelines.
Next Steps
To resolve this issue, please revise your app to address all instances of this type of issue.
Resources
For information on improving and enhancing your app:
Please see attached screenshot for details.
As per apple custom button guidelines the apple logo must be left aligned and text center aligned.
That might be the issue. But no option to align the logo. Please help to solve the issue.
https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/buttons/
I have a question.
I sign in with apple a my Application, and i log out.
Then i try to sign in it, then i asked to create an account not to sign in ....
In my app, this screen always pop up when i sign in.
https://i.imgur.com/BPFfoRR.png
but i want other screen below if user have signed up my application .
https://i.imgur.com/pbhTRzj.png
The main code below..
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);
switch (result.status) {
case AuthorizationStatus.authorized:
final AppleIdCredential auth = result.credential;
final OAuthProvider oAuthProvidewr =
OAuthProvider(providerId: "apple.com");
final AuthCredential credential = oAuthProvidewr.getCredential(
idToken: String.fromCharCodes(auth.identityToken),
accessToken: String.fromCharCodes(auth.authorizationCode));
Apple rejected our app for the following reason. They won't explain what the exact problem is.
We noticed an issue in your app that contributes to a lower quality user experience than Apple users expect:
- Your app uses Sign in with Apple as a login option but does not use Sign in with Apple button design, branding and/or user interface elements appropriately as described in the Sign in With Apple Human Interface Guidelines.
Next Steps
To resolve this issue, please revise your app to address all instances of this type of issue.
Resources
For information on improving and enhancing your app:
- Watch the video The Ingredients of Great Apps to understand the basics of great apps.
- Watch the video iPhone and iPad User Interface Design for practical design tips.
- Watch iOS Development Videos to learn about programming and design tips.
- Review the iOS Human Interface Guidelines and ensure that your app's interface and design adhere to these guidelines.
Please see attached screenshot for details.
Thank you soo much for this package!
Does your plugin also supports returning firebaseuser instance? Would be soo great for firebase projects :)
Thanks a lot!
Gesendet von meinem Pixel 2 XL mit FastHub
I have an app using your library and I encountered the following issue while pushing it to Appstore. Can anyone help me to fix this issue asap ?
From Apple
4. Design: Preamble
Thank you for your resubmission. We found that your app is still not in compliance with the App Store Review Guidelines.
Guideline 4.0 - Design
We noticed an issue in your app that contributes to a lower quality user experience than Apple users expect:
Next Steps
To resolve this issue, please revise your app to address all instances of this type of issue.
Resources
For information on improving and enhancing your app:
Hi - I have successfully authenticated against Apple and get an AuthorizationStatus.authorized code.
I now want to use the credentials to sign in with the apple ID with Firebase, i.e I have this enabled in Firebase console :
To do this I use the identifyToken returned in the result but when I try and use FirebaseAuth.signInWithCustomToken(appleToken) I get :
is there something I'm missing here ?
Hello,
I know this plugin provide an apple sign in button but the icon is too small and apple reject my build.. Can I create my own button and use this plugin?..
Also, I see another plugin is available for apple login with flutter. Is this plugin still maintain and is this one better.
Hi,
I have trouble after archiving my app. I sure my bundle id is the same on app store connect.
See on my picture. Anyone can help me?
Im trying to implement the apple sign in to deploy my app to the App Store but we found that after the first sign in , the object result.credential.email and fullName returns null, also the authorized scopes is always empy??
Dont know how to proceed after this , any help is welcome
You're very welcome to PR on https://github.com/Solido/awesome-flutter so more people can use your plugin ! Thank you.
Is it normal that subsequent calls to "Sign In with Apple" display the dialog that details what the Sign In with Apple is all about and present the user with the dialog about how to share email? It seems to me that should only happen the first time and, after successful login, the only thing needed is Touch ID.
When using Face ID login or ANY Authentication mechanism for an iPhone - AuthorizationResult contains ALL null fields. This includes CREDENTIAL.
When we test on a simulator - we get values for CREDENTIAL, i.e email, fullname, familyName, givenName...
Tested on live iPhone X and iPhone 11 Pro MAX device.
My sign in code is simple:
`
void _signInWithApple(BuildContext context) async {
var bloc = Provider.of(context, listen: false);
print("_signInWithApple");
if (!await AppleSignIn.isAvailable()) {
print("AppleSignIn is not availalbe !");
return null; //Break from the program
}
else {
print("AppleSignIn is availalbe !");
}
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);
switch (result.status) {
case AuthorizationStatus.authorized:
print("Sign in successfully");
// Get credential and then signin with credential, and do something with particular credential
break;
case AuthorizationStatus.error:
print("Sign in failed: ${result.error.localizedDescription}");
break;
case AuthorizationStatus.cancelled:
print('User cancelled');
break;
}
}
`
But my debugging information found that
flutter: _signInWithApple
flutter: AppleSignIn is availalbe !
[core] Authorization failed: Error Domain=AKAuthenticationError Code=-7034 "(null)" UserInfo= }
flutter: Sign in failed: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
Since apple sign in is available in this device then I search to find out more information from error 1000.
I found recently discussion in react native ref
I just login into https://appleid.apple.com/account/manage
Then scroll down a little bit to remove emulator from the device list then it's simply work.
Observed logging in required 2-factors authentication.
I hope it help you guy as well.
Using Flutter version 1.12.13+hotfix.5, I get this when trying to build the app on android:
A problem occurred configuring root project 'apple_sign_in'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
I've followed the instructions and copied the button and handler code from the example into my app. When the code executes
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);
I get the exception below.
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method performRequests on channel dev.gilder.tom/apple_sign_in)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
<asynchronous suspension>
#1 AppleSignIn.performRequests (package:apple_sign_in/apple_sign_in.dart:42:41)
<asynchronous suspension>
#2 _LoginScreenState.doLoginWithApple (package:ping/screens/loginScreen/Login.screen.dart:306:58)
<asynchronous suspension>
#3 _AppleSignInButtonState.build.<anonymous closure> (package:apple_sign_in/apple_sign_in_button.dart:54:17)
#4 TapGestureRecognizer._checkUp.<anonymous closure> (package:flutter/src/gestures/tap.dart:363:49)
#5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
#6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:363:11)
#7 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7)
#8 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9)
#9 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13)
#10 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11)
#11 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
#12 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
#13 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
#14 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
#15 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
#16 _rootRunUnary (dart:async/zone.dart:1136:13)
#17 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
#19 _invoke1 (dart:ui/hooks.dart:263:10)
#20 _dispatchPointerDataPacket (dart:ui/hooks.dart:172:5)
Have I missed something obvious or is this an issue with the plugin?
Thanks for creating this package!
Could you be so kind and add a proper license to this project so we are in the clear when using it in our projects?
Hello,
I've been using this plugin in my project for a few months now, everything working fine, including published in the Apple Store. However, this week, when trying to upload a new version to the Apple Store, the app was rejected in the Apple review process, with the error "Sign up not completed", and we did not make any changes to the sign in apple process.
Has anyone had this problem?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.