my_chips_flutter_sdk 1.0.0 copy "my_chips_flutter_sdk: ^1.0.0" to clipboard
my_chips_flutter_sdk: ^1.0.0 copied to clipboard

MyChips Flutter Sdk.

MyChips Flutter SDK Package #

Description #

MyChips Flutter SDK package

Usage #

Initializing the sdk #

You must initialize the sdk using your api key before using it.

await MCOfferwallSdk.instance.init(yourApiKey);

Setting user id #

Optionally you can set the user id.
If you do not provide an user id, the sdk will automatically generate one.
If an user id is set (either manually or automatically) it will be used as long as a new user id is not provided manually.
To manually provide an user id:

await MCOfferwallSdk.instance.setUserId(userId); 

Checking for a reward #

To check for a reward use the checkReward function. It requires your adunitId, a reward callback(which will be called if the checks shows that there is a reward), and an on error callback:

MCOfferwallSdk.instance.checkReward(
    adUnitId: yourAdUnitId,
    onReward: (reward) {
        //do something with the reward, here we just print it out
        print("Reward: $reward");
    },
    onError: (e, st) {
        //do something on error, here we just print it out
        print("Error: $e");
        print("Stacktrace: $st");
    });

Showing the offerwall #

To show the offerwall we provide you with a widget called OfferwallPage. You should show it as a page using your preferred navigation package/method.

Example using the default flutter navigator:

Navigator.of(context).push(
    MaterialPageRoute(
        builder: (context) => OfferwallPage(
        adunitId: yourAdUnitId,
        ),
    ),
);

1
likes
140
points
30
downloads

Publisher

verified publishermychips.io

Weekly Downloads

MyChips Flutter Sdk.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, http, shared_preferences, url_launcher, uuid, webview_flutter

More

Packages that depend on my_chips_flutter_sdk