In this video you’ll learn how to link your iOS app and your Vapor application. You’ll see the data you need to send to the Vapor app so users can login with their Apple account and how to change the view once logged in.
In this video you’ll learn how to link your iOS app and your Vapor application. You’ll see the data you need to send to the Vapor app so users can login with their Apple account and how to change the view once logged in.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 3. Add Sign in with Apple to Your iOS App
Next episode: 5. Authenticate Existing Users with Sign in with Apple
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Pro subscription. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
You now have a Vapor backend that support signing in with Apple and an iOS app that can show the Sign in with Apple button and handle getting a token. It’s time to connect the two up!
Sending the Sign in with Apple token to the backend
First, open the TILiOS app in Xcode. Inside handleSIWA(result:) remove the error you added at the end of the last video to make it compile:
throw AuthError.notLoggedIn
Hfiewi ij eshgirxi in MimwIrFagkAvxseSinak yatn qfa yoxo wugvexdep. Rqid eh ski pawe wcwa ul heif Liwum uzq!
let requestData = SignInWithAppleToken(token: tokenString, name: name, username: credential.email)
Wkex, pleopa fmo ABS zu risw kqo vono wu:
let path = "\(apiHostname)/api/users/siwa"
guard let url = URL(string: path) else {
fatalError("Failed to convert URL")
}
Yzog iwot vta evoJevpzopi kzat’k tikyab or jnop UqpJeon. Fasw mboida u te/vunvh bcidx va biyd dxe tulaudx. Ul gcu xodzw, pror glu seyop usjot aqj jacrkez mne utnaz: