Last updated:
0 purchases
flutter yandex games
Flutter Web plugin for Yandex Games Sdk.
Features #
This is the minimal sufficient level of features I need for My project.
Feel free to contribute. Or open an issue if you need more features.
Player data save/load.
Show Fullscreen Ad.
Show Rewarded Ad.
Getting started #
Installation #
Add this to your index.html
<script src="https://yandex.ru/games/sdk/v2"></script>
copied to clipboard
dependencies:
...
flutter_yandex_games: 0.0.6
copied to clipboard
If you get 404 error for js files in your game after uploading to Yandex, remove
<base href="$FLUTTER_BASE_HREF">
copied to clipboard
from your index.html
Usage #
Init Sdk #
await YandexGames.init();
copied to clipboard
Get Player Data #
var player = YandexGames.getPlayer();
var data = await player.getData();
copied to clipboard
Set Player Data #
var player = YandexGames.getPlayer();
player.setData({"gold": 100});
copied to clipboard
Show Fullscreen Ad #
YandexGames.showFullscreenAd(
onClose: (wasShown){
},
onError: (error){
//Show error
},
);
copied to clipboard
Show Rewarded Video Ad #
YandexGames.showRewardedVideoAd(
onOpen: (){
debugPrint("rewardedVideo onOpen");
},
onRewarded: (){
//Give reward
},
onClose: (){
debugPrint("rewardedVideo onClosed");
},
onError: (error){
//Show error
},
);
copied to clipboard
Ask review #
YandexGames.canReview().then((response) {
if(response.value){
YandexGames.requestReview();
}
});
copied to clipboard
Player Authorization #
Check if player is Authorized:
YandexGames.getPlayer().isAuthorized()
copied to clipboard
Open auth dialog:
YandexGames.openAuthDialog().then((_) {
//Player Authorization Success
}, onError: (error) {
//Player Authorization Fail
});
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.