flutter_yandex_games 0.0.6 copy "flutter_yandex_games: ^0.0.6" to clipboard
flutter_yandex_games: ^0.0.6 copied to clipboard

Platformweb

Flutter Web plugin for Yandex Games Sdk. Show ad, save/load player data.

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>
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

Usage #

Init Sdk #

await YandexGames.init();

Get Player Data #

var player = YandexGames.getPlayer();
var data = await player.getData();

Set Player Data #

var player = YandexGames.getPlayer();
player.setData({"gold": 100});

Show Fullscreen Ad #

YandexGames.showFullscreenAd(
  onClose: (wasShown){
    
  },
  onError: (error){
    //Show error
  },
);

Show Rewarded Video Ad #

YandexGames.showRewardedVideoAd(
  onOpen: (){
    debugPrint("rewardedVideo onOpen");
  },
  onRewarded: (){
    //Give reward
  },
  onClose: (){
    debugPrint("rewardedVideo onClosed");
  },
  onError: (error){
    //Show error
  },
);

Ask review #

YandexGames.canReview().then((response) {
  if(response.value){
    YandexGames.requestReview();
  }
});

Player Authorization #

Check if player is Authorized:

YandexGames.getPlayer().isAuthorized()

Open auth dialog:

YandexGames.openAuthDialog().then((_) {
  //Player Authorization Success
}, onError: (error) {
  //Player Authorization Fail
});
8
likes
150
points
29
downloads

Publisher

verified publisherkoallider.me

Weekly Downloads

Flutter Web plugin for Yandex Games Sdk. Show ad, save/load player data.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, js

More

Packages that depend on flutter_yandex_games