scatesdk_flutter 0.3.6
scatesdk_flutter: ^0.3.6 copied to clipboard
Scate SDK is made for developers to integrate Scate's services into their apps. Please visit https://www.scate.io for more information.
ScateSDK Flutter Plugin #
Installation #
Install via CLI;
flutter pub add scatesdk_flutter
Or
Add the following into your pubspec.yaml
file;
dependencies:
scatesdk_flutter: ^0.3.6
Usage #
Initialize the SDK #
import 'package:scatesdk_flutter/scatesdk_flutter.dart';
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
initPlatformState();
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
// ... Your initialization code
// Adjust SDK initialization
// ...
// Initialize ScateSDK
ScateSDK.Init("<your app id>");
// make sure to set adid from Adjust SDK
String adid = await Adjust.adid();
ScateSDK.SetAdid(adid);
}
}
Send Events #
To send events, you can use the following code:
ScateSDK.Event("button_clicked");
Send Events with Additional Data #
ScateSDK.EventWithValue("button_clicked", "subscribe_btn");
Get Remote Config for Key #
ScateSDK.GetRemoteConfig('key', 'defaultValue');
Add Listener #
ScateSDK.AddListener(ScateEvents.REMOTE_CONFIG_READY, (event) => {});
Remove Listener #
ScateSDK.RemoveListener(ScateEvents.REMOTE_CONFIG_READY);
Clean Listeners #
ScateSDK.CleanListeners(ScateEvents.REMOTE_CONFIG_READY);