0.1.32 • Published 1 year ago
rnadspostx v0.1.32
rnadspostx
AdsPostX offers a react native package designed to help you integrate AdsPostX into your react native mobile application within minutes and start generating more revenue and increasing sales.
Installation
npm install rnadspostx
Usage
- Init AdsPostX:
const sdkId = 'a359ddi39903994f';
AdsPostXPlugin.init(sdkId, (response) => {
/* if response is true, mean init call is success.
otherwise you will get error with response.*/
}
});
- Load AdsPostX Offers:
const payload = { firstname: 'john', country: 'US' };
AdsPostXPlugin.load((response) => {
/*
if response is 'true' mean offer loaded successfully,
else check 'error' field for error while loading offers.
*/
}, payload);
- Show AdsPostX Offers:
// values used here are just for demo purpose, use actual values when you are integrating SDK.
const showOptions = {
position: {
topMargin: 5.0,
rightMargin: 5.0,
bottomMargin: 5.0,
leftMargin: 5.0,
},
styles: {
transparent: true,
type: 'popup', // OR 'fullscreen',
},
callbacks: {
showCallback: () => {
console.log('Show callback called');
},
errorCallback: (event) => {
console.log('Error callback called:', event);
},
dismissCallback: () => {
console.log('Dismiss callback called');
},
},
};
AdsPostXPlugin.show(showOptions);
- Get Offers
const sdkId = 'YOUR_SDK_ID';
const payload = {
country: 'USA',
firstname: 'Dev',
creative: '1',
dev: '1',
};
try {
const responseData = await AdsPostXPlugin.getOffers(sdkId, payload);
// to access offers
if (responseData.status) {
const offers = responseData.response.data.offers;
}
} catch (error) {
// Handle any errors that occurred during the getOffers call...
}
- Set Environment
AdsPostXPlugin.setEnvironment(0); // for 'live' environment.
OR;
AdsPostXPlugin.setEnvironment(1); // for 'test' environment.
- Set Debug Log
AdsPostx.setDebugLog(true);
OR;
AdsPostx.setDebugLog(false);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library
0.1.32
1 year ago
0.1.30
2 years ago
0.1.31
2 years ago
0.1.13
2 years ago
0.1.14
2 years ago
0.1.27
2 years ago
0.1.28
2 years ago
0.1.29
2 years ago
0.1.20
2 years ago
0.1.21
2 years ago
0.1.22
2 years ago
0.1.24
2 years ago
0.1.26
2 years ago
0.1.16
2 years ago
0.1.17
2 years ago
0.1.18
2 years ago
0.1.19
2 years ago
0.1.10
2 years ago
0.1.11
2 years ago
0.1.12
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.9
2 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago