appstorys 0.0.7 appstorys: ^0.0.7 copied to clipboard
In app elements like Stories, Picture in Picture, Banner, FLoater
FinalFlutterSDK #
Final AppStorys Flutter SDK
Example of using base class #
UserData? _data;
String? _access_token;
final String _userId = 'YOUR_USER_ID';
final String _appId = 'YOUR_APP_ID';
final String _accountId = 'YOUR_ACCOUNT_ID';
final String _screenName = 'YOUR_SCREEN_NAME';
final Map<String, String> _attributes = {
'key': 'value'
};
@override
void initState() {
_init();
super.initState();
}
Future<void> _init() async {
await AppStorys.verifyAccount(_accountId, _appId);
await AppStorys.trackScreen(_appId, _screenName);
final verifyUser = await AppStorys.verifyUser(_userId);
if (verifyUser != null) {
setState(() {
_data = verifyUser;
});
}
await AppStorys.trackUser(_userId, _attributes);
final access_token = await AsyncStorageLocal(keyFile: 'access_token').readString();
if (access_token.isNotEmpty) {
setState(() {
_access_token = access_token;
});
}
}