



This works great for users who only use one device, but it has one significant drawback: you will be assigned a new user ID every time you sign in to the app on a new device. This ID will then be stored in the local keychain, to make it easier to transparently sign in the user when they return to the app. Instead, when you ask Firebase Auth to sign in a user anonymously, the SDK calls an API endpoint that returns a globally unique ID. For a number of reasons, this is not what Firebase does. Now you might be wondering how Anonymous Auth determines this unique user ID, and some of you might suspect Firebase is using the device ID or some other user- or device-specific feature to compute the user ID. We're using Firebase Anonymous Authentication to get a unique ID for each user to make sure we can store data per user, and don't accidentally mix up the tasks of person A and B (I'm pretty sure my kids would love to see their chores end up on my task list, but generally, this is not how task lists work - sorry to break the bad news to you.). All tasks the user enters are synchronised with Cloud Firestore. So far, users of our application can enter new tasks, mark them as done, or modify them. So, let's get started! Why are we doing this?īefore we dive into implementing Sign in with Apple, let's take a step back and look at what we did in the past episode. In part 3 (which you are reading right now), we're going to implement Sign in with Apple, allowing users to sign in from multiple devices to access their data, and laying the groundwork for advanced features such as sharing tasks with your family and co-workers.In part 2, we connected the application to Firebase, and synchronized the user's tasks with Cloud Firestore.In part 1 of the series, we focussed on building the UI with SwiftUI, using a simple data model.
#Sign in with apple server side series
Here is an overview of the series and what we're going to build: This article is part of a series of articles that explores building a real-world application using SwiftUI, Firebase, and a couple of other technologies.
