Installation
npm install @perkox/react-native-sdk
# or using yarn
yarn add @perkox/react-native-sdk
# or using pnpm
pnpm add @perkox/react-native-sdk
# iOS Pod installation
cd ios && pod install && cd ..Implementation Example
App.tsxtypescript
import React, { useEffect } from 'react';
import { View, Button, Alert } from 'react-native';
import PerkoxOfferwall from '@perkox/react-native-sdk';
export default function App() {
useEffect(() => {
// 1. Initialize Perkox
PerkoxOfferwall.init({
appId: 'YOUR_APP_ID',
playerId: 'USER_12345',
});
// 2. Set reward listener
const rewardListener = PerkoxOfferwall.addEventListener(
'onReward',
(reward) => {
console.log('Reward received:', reward.amount, reward.status);
Alert.alert('Reward!', `You earned ${reward.amount} virtual currency!`);
}
);
return () => {
rewardListener.remove();
};
}, []);
const handleOpenOfferwall = () => {
// 3. Show offerwall
PerkoxOfferwall.show();
};
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Button title="Open Perkox Offerwall" onPress={handleOpenOfferwall} />
</View>
);
}Expo Support
Works with Expo projects using continuous native generation (
npx expo prebuild) or custom development builds (npx expo run:android / npx expo run:ios).
