This library enables you to use additional authentication methods from the standard login flow.
This library can only be used with Customer Data Cloud Swift SDK version 1.0.6 or above.
Enabling Push Notifications
To integrate the authentication library within your application make sure that you have successfully integrated the Swift core library as it is a mandatory dependency for using the new authentication flows.
To use Push Authentication, add the following line to your AppDelegate.swift:
Before beginning your implementation, it is mandatory to implement the Push notification service inside the Swift Core SDK.
Add the Gigya Messaging Service
- Enable remote notifications: In your app project, go to your project target and open Capabilities > Background Modes. Make sure Remote notifications is enabled.
Allow Firebase to send foreground notifications: After you called FirebaseApp.configure() add the follow line:
Add Firebase delegate: The Gigya server requires receiving the push token to send push notifications to your user's devices. To do so, add the following to your AppDelegate.swift:
Handling push notifications: to let the SDK handle incoming push notifications, add the following to your AppDelegate.swift:
Notification interaction: Gigya's notifications require action confirmations (end-user approving or denying the push opt-in). To open the actions alert confirmation, add the following to your AppDelegate.swift.
Before a user can authenticate with a push notification, they have to be registered on your app (with the standard SAP Customer Data Cloud registration flow) and must have an active session. In addition, to start the Push Authentication flow for a user, their device needs to be registered for this service. Device registration is done by calling the library "registerForAuthPush" method:
Once the device is successfully registered, when the user starts a login process on a separate device (e.g. desktop), the registered mobile device will receive a push notification which they can approve or deny: