Free to Play Support
Reward Provider
import { registerRewardProvider, type LucraReward } from '@lucra-sports/lucra-react-native-sdk';
async function getAvailableRewards(): Promise<LucraReward[]> {
return [
{
rewardId: 'Reward123',
title: 'My awesome reward',
descriptor: 'descriptor',
iconUrl: 'http://url.com/blah.jpg',
bannerIconUrl: 'another jpg url',
disclaimer: 'disclaimer',
metadata: JSON.stringify({ otherData: 'you want' }),
},
];
}
async function claimReward(reward: LucraReward) {
// Allow the user to view the details of the reward.
}
function viewRewards() {
// Show the users the rewards
}
LucraClient.registerRewardProvider(getAvailableRewards, claimReward, viewRewards);Last updated
