Sample App for TwitCasting API v2 Client library. This App is not convenience but you can know how to use the TwitCasting API v2 Client library.
- You have to generate your client id and set Callback URL via the Developer page. Make sure to set the appropriate scope.
- Open TwitCastingAPISampleApp.swift and replace YOUR_CLIENT_ID and YOUR_CALLBACK_URL_SCHEME with your own.
import SwiftUI
import TwitCastingAPI
@main
struct TwitCastingAPISampleApp: App {
@StateObject var auth = TwitCastingAuth(clientId: "YOUR_CLIENT_ID", callbackURLScheme: "YOUR_CALLBACK_URL_SCHEME")
var body: some Scene {
WindowGroup {
if auth.token.isEmpty {
LoginView(auth: auth)
} else {
APITestView()
.environmentObject(auth)
}
}
}
}