Follow the steps described here to set up push messaging from the server side.
On Android, you will need to add a
google-services.json file to your app, that you can generate in the Firebase Console under
Settings > General > Your Apps. Make sure that it has an entry for the application id(s), e.g., com.nextauth.authenticator, of your app, including all build flavours, e.g., com.nextauth.authenticator.beta.
Apple enables updating a notification's content before it is displayed to the user even when the device is locked. To this end, you will need to create a new Notification Service app extension. Additionally, the extension and your app need to be members of an App Group so that they can share data.
First, navigation to Apple's Developer portal to create an App Group and an App ID for the app extension. The App Group's identifier will typically have the form group.com.nextauth.Authenticator. Once it has been created, don't forget to grant the app's Bundle ID the capability to access this group. Next, create a new App ID for the Notification Service extension. We recommend setting it to com.nextauth.Authenticator.NSExtension, but you are of course free to choose this value. Ensure that you also grant this ID the App Group entitlements with the relevant group.
Once you've completed these steps, open Xcode and choose
File > New > Target and choose *Notification Service Extension in the dialog. Fill out the following screen as required by your setup, where we typically set the target's name to
AuthenticatorNSExtension. We will not list the required source files for the extension here, but instead refer to the Acme sample app for more details.