torus_direct

Creator: coderz1093

Last updated:

0 purchases

torus_direct Image
torus_direct Images
Add to Cart

Description:

torus direct

torus_direct #
Torus CustomAuth SDK for Flutter applications.
Get started #
Checkout example/.
Usage #
Add torus_direct package to your pubspec and import the package:
import 'package:torus_direct/torus_direct.dart';
copied to clipboard
Decide which OAuth provider you'll being using. See Torus CustomAuth supported OAuth providers.
Go to Torus Developer and create your verifier for your OAuth provider of choice with corresponding configuration.
Initialize the package:
await TorusDirect.init(
network: TorusNetwork.testnet,
redirectUri: Uri.parse(
'torusapp://org.torusresearch.torusdirectandroid/redirect')); // Replace with your app URL
copied to clipboard
Trigger login while your user is interacting with your application:
TorusDirect.triggerLogin(
typeOfLogin: TorusLogin.google,
verifier: 'google-lrc',
clientId:
'221898609709-obfn3p63741l5333093430j3qeiinaa8.apps.googleusercontent.com',
jwtParams: {});
copied to clipboard
Android-specific configuration #
Add custom URL schemes to your app by adding the following to your app android/app/build.gradle:
manifestPlaceholders = [
'torusRedirectScheme': 'torusapp',
'torusRedirectHost': 'org.torusresearch.torusdirectandroid',
'torusRedirectPathPrefix': '/redirect'
]
copied to clipboard
iOS-specific configuration #
Open the project in XCode (open ios/Runner.xcworkspace) and add a custom URL types.
Add the following to ios/Runner/AppDelegate.swift to handle redirect URL:
import UIKit
import Flutter
import TorusSwiftDirectSDK

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}

// Handle redirect URL and send to Torus Direct instance
override func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
TorusSwiftDirectSDK.handle(url: url)
return true
}
}

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.