-
Notifications
You must be signed in to change notification settings - Fork 13
v1 API Discussion #1
Comments
really good job with the readme! Looks good to me.
👍
👍 re https://github.com/react-native-community/apple-sign-in#signinwithappleaddrevokelistener - @matt-oakes can you point me to the relevant apple docs? regarding styling the button docs there are two initializers that influence the button styling, but we instantiate the button here and I don't know if the js props are accessible in there.. Anyone has experience with that? Other native view managers seem to simply instantiate views and then use setters to set various properties example |
"Documentation" is strong word for what Apple provide for the revise notification: The Swift example code they gave in the presentation was this though: // Register for revocation notification
let center = NotificationCenter.default
let name = NSNotification.Name.ASAuthorizationAppleIDProviderCredentialRevoked
let observer = center.addObserver(forName: name, object: nil, queue: nil) { (Notification) in
// Sign the user out, optionally guide them to sign in again
} |
Awesome that you guys are already planning this. The work you already put in is great! The current approach is also quite nice. Here are a few thoughts of mine to it:
We could name it
I think it makes sense to have them as a part of the main export (like you did it) and not separated from it. SuggestionsEnumsI propose to name types camel case and as plural cause they container multiple enums. I also think it makes sense to have the actual enums in uppercase and separated with underscores e.g.:
Thats how I see enums treated commonly. SignInWithApple.perform()I think it makes sense to name the function
I get that you want to stay as close as possible to Apples API but I think it makes sense to do some thinks differently cause react-native is a different eco system and most of the people are more familiar with that than with native. So I think it makes sense to stick to these known patterns. Also calls generally happen differently in native iOS than in JS e.g. the Would be happy to get some thoughts on these ideas. |
Thanks for the feedback @Jobeso! I partly agree with you on the enums case. I have changed all of the values to be SNAKE_CASE, however, I think it reads better when the names of the enums are singular. Some feel very awkward if they are plural. I also partly agree with you on the method and value names. I have changed I will open a PR now with these changes. |
How about keeping both names? |
@redgenie I don't think that gains very much and just increases the API surface area. We'll take a look when we start implementation. |
Is there a plan for an Android Web-based implementation? |
I have gone ahead and created a detailed README for a possible API that we could implement for this library. You can see the details of it here:
https://github.com/react-native-community/apple-sign-in/blob/46aab22632ca482e737f6447a480057648c07710/README.md
All of this is only a suggestion and we should discuss if this API makes sense and open PRs to make changes to it as required.
Reasoning for the proposed API
The goal is to come up with an API that is close to the one provided by Apple, but makes sense in a React context. I have tried to stick to the names that Apple has used and provide access to all of the options which they allow developers to call. We want to make sure our API is as flexible as the iOS one we are wrapping.
Open questions
SignInWithApple
andSignInWithAppleButton
) and the types.SignInWithApple
orSignInWithAppleButton
) or should they be their own main export (SignInWithAppleButtonType
rather thanSignInWithAppleButton.Type
).The text was updated successfully, but these errors were encountered: