0.1.32 • Published 4 months ago

rnadspostx v0.1.32

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

  1. 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.*/
    }
});
  1. 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);
  1. 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);
  1. 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...
}
  1. Set Environment
AdsPostXPlugin.setEnvironment(0); // for 'live' environment.

OR;

AdsPostXPlugin.setEnvironment(1); // for 'test' environment.
  1. 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

4 months ago

0.1.30

10 months ago

0.1.31

10 months ago

0.1.13

11 months ago

0.1.14

11 months ago

0.1.27

10 months ago

0.1.28

10 months ago

0.1.29

10 months ago

0.1.20

11 months ago

0.1.21

10 months ago

0.1.22

10 months ago

0.1.24

10 months ago

0.1.26

10 months ago

0.1.16

11 months ago

0.1.17

11 months ago

0.1.18

11 months ago

0.1.19

11 months ago

0.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago