Last updated:
0 purchases
my chips 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);
copied to clipboard
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);
copied to clipboard
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");
});
copied to clipboard
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,
),
),
);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.