truvideo_core_sdk 0.0.1
truvideo_core_sdk: ^0.0.1 copied to clipboard
Provides essential user authentication for all SDK modules, ensuring seamless operation across the platform.
Truvideo Core SDK #
This Plugin demonstrates the integration of the TruvideoCoreSdk for authentication and platform-specific functionality. It includes features such as authentication, authentication status checking, and clearing authentication.
Supported Platforms #
- ✅ Android
- ✅ iOS
Features #
- Authenticates using API Key and Secret Key
- Checks authentication status
- Clears authentication
Requirements #
- API Key & Secret Key: Required for authentication
- TruvideoCoreSdk Plugin: Must be properly installed and configured in your Flutter project
Setup #
- Add TruvideoCoreSdk Plugin to your project.
- Install dependencies using:
flutter pub get - Replace the placeholders with actual API keys:
final String apiKey = "YOUR_API_KEY"; // Replace with your API Key final String secretKey = "YOUR_SECRET_KEY"; // Replace with your Secret Key - Run the app:
flutter run
Authentication Process #
- Generates a payload for authentication
- Uses SHA256 HMAC to sign the payload
- Authenticates using
TruvideoCoreSdk.authenticate() - Initializes authentication with
TruvideoCoreSdk.initAuthentication() - Updates authentication status
Code Overview #
The main authentication logic is implemented in _MyAppState:
Future<void> authenticate() async {
try {
String payload = await TruvideoCoreSdk.generatePayload();
String signature = toSha256String(secret: secretKey, payload: payload) ?? '';
await TruvideoCoreSdk.authenticate(
apiKey: apiKey,
signature: signature,
payload: payload,
externalId: "",
);
await TruvideoCoreSdk.initAuthentication();
} catch (e) {
}
}
License #
MIT #
Support #
If you have any questions or suggestions regarding the SDK, please contact us at support@truvideo.com.