MoEngageJwtAuthenticationError

@objc
public final class MoEngageJwtAuthenticationError : MoEngageAuthenticationError

JWT Authentication Error class that inherits from the base authentication error.

This class represents JWT-specific authentication errors that occur during network requests in the MoEngage SDK. It provides JWT-specific error codes and payload information.

Usage Example

class MyJwtListener: MoEngageAuthenticationError.Listener {
    func onError(_ error: MoEngageAuthenticationError) {
        if let jwtError = error as? MoEngageJwtAuthenticationError {
            // Handle JWT-specific error
            switch jwtError.details.code {
            case .timeConstraintFailure:
                // Handle token expiration - refresh token
                refreshJwtToken()
            case .invalidSignature:
                // Handle signature validation failure - re-authenticate
                reAuthenticate()
            case .tokenNotAvailable:
                // Handle missing token - provide new token
                provideJwtToken()
            default:
                // Handle other errors
                logError(jwtError)
            }
        }
    }
}
  • Computed property for accessing the JWT-specific error details.

    Declaration

    Swift

    public override var details: Details { get }
  • JWT Authentication Error Details.

    This class contains JWT-specific error details that provide additional context about the authentication error.

    See more

    Declaration

    Swift

    @objc(MoEngageJwtAuthenticationErrorDetails)
    public final class Details : MoEngageAuthenticationError.Details