Flutter Web plugin for Yandex Games Sdk.
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.
Add this to your index.html
<script src="https://yandex.ru/games/sdk/v2"></script>
dependencies:
...
flutter_yandex_games: 0.0.6
If you get 404 error for js files in your game after uploading to Yandex, remove
<base href="$FLUTTER_BASE_HREF">
from your index.html
await YandexGames.init();
var player = YandexGames.getPlayer();
var data = await player.getData();
var player = YandexGames.getPlayer();
player.setData({"gold": 100});
YandexGames.showFullscreenAd(
onClose: (wasShown){
},
onError: (error){
//Show error
},
);
YandexGames.showRewardedVideoAd(
onOpen: (){
debugPrint("rewardedVideo onOpen");
},
onRewarded: (){
//Give reward
},
onClose: (){
debugPrint("rewardedVideo onClosed");
},
onError: (error){
//Show error
},
);
YandexGames.canReview().then((response) {
if(response.value){
YandexGames.requestReview();
}
});
YandexGames.getPlayer().isAuthorized()
YandexGames.openAuthDialog().then((_) {
//Player Authorization Success
}, onError: (error) {
//Player Authorization Fail
});