Class
GooglePlayJWTGenerator
Generates and caches Google OAuth2 access tokens for service account authentication.
actor GooglePlayJWTGeneratorOverview
Uses RS256 JWT signing to authenticate with https://oauth2.googleapis.com/token, mirroring the pattern of JWTGenerator in the App Store Connect client.
Usage
let generator = GooglePlayJWTGenerator(credentials: credentials)
let token = try await generator.cachedOrNewToken()
// Firebase App Distribution needs a different scope:
let firebase = GooglePlayJWTGenerator(credentials: credentials, scope: .cloudPlatform)Topics
Structures
struct ScopeAn OAuth2 scope requested when exchanging the signed JWT for an access token.
Initializers
init(credentials: GoogleServiceAccountCredentials, scope: GooglePlayJWTGenerator.Scope)Creates a
GooglePlayJWTGeneratorwith service account credentials.
Instance Methods
func cachedOrNewToken() async throws -> StringReturns a valid access token, reusing the cached token if it hasn’t expired.
Default Implementations
Relationships
Conforms To
Swift.SendableSwift.SendableMetatype_Concurrency.Actor