B4i Library User Authentication with Apple ID


Staff member
Licensed User
If you are using FirebaseAuth then use this class instead: https://www.b4x.com/android/forum/threads/sign-in-with-apple-and-firebase.116280/

Starting from iOS 13 there is integral support for letting the user sign in with the user Apple ID.

The AppleAuthButton is a custom view that manages authentication.

You need to add the AuthResult event which will be raised when the user successfully signs in:
Sub AppleAuthButton1_AuthResult (Name As String, Email As String)
    Msgbox($"Name: ${Name}
Email: ${Email}"$, "") 
End Sub
1. Enable 'Sign In With Apple' in the app identifier page in Apple developer console. The app id must be a non-wildcard id.
2. Download an updated provision profile and set it with:
#ProvisionFile: xxx.mobileprovision
3. Add to main module:
#AdditionalLib: AuthenticationServices.framework
#MinVersion: 13
#Entitlement: <key>com.apple.developer.applesignin</key><array><string>Default</string></array>
4. Add the class to your project and add the custom view.

Depends on: iXUI library.


The user will only be able to authenticate succeffully once. The username and email are empty if the user tries to sign in again.
This means that you must save the username and email and don't let the user sign in again.
During development you can reset it in the settings app:

Settings > Apple Id > Password & Security > Apple ID logins > {YOUR APP} > Stop using Apple ID


Last edited:


Licensed User
Is Apple authentication only functional from version. 13? For the previous ones, how can I do?