Skip to content

tosakakun/TwitCastingAPISample

Repository files navigation

TwitCastingAPISample

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.

Usage

  1. You have to generate your client id and set Callback URL via the Developer page. Make sure to set the appropriate scope.
  2. 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)
            }
        }
    }
}

About

Sample App for TwitCasting API v2 Client library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages