2.4.0 • Published 3 days ago

react-native-idx-dmp-sdk v2.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

react-native-idx-dmp-sdk

IDX DMP react-native SDK

Installation

yarn add react-native-idx-dmp-sdk

Usage

import {
  initSdk,
  sendEvent,
  getCustomAdTargeting,
  resetUserState,
} from 'react-native-idx-dmp-sdk';

// ...

const PROVIDER_ID = '00000000-0000-0000-0000-000000000000';

// Init sdk before any other events
initSdk(PROVIDER_ID, 'My app name').then(() => {
  // setIsReady
});


// Prepare event data
const pageState = {
  url: '',
  title: '',
  domain: '',
  author: '',
  category: '',
  description: '',
  tags: 'tag1,tag2,tag3',
}

sendEvent(pageState).then(async () => {
  // event is completed
  const adRequstData = {
    customData: await getCustomAdTargeting(),
  }
  // Send Ad request with adRequstData
})

Web View connector

import { WebView } from 'react-native-webview';
import { DMPWebViewConnector } from 'react-native-idx-dmp-sdk';

// ...

const webViewConnector = new DMPWebViewConnector();

// ...

<WebView onMessage={webViewConnector.handleMessage} />

// ...

const showAd = () => {
  const adRequstData = {
    customData: webViewConnector.getCustomAdTargeting(),
  }
  // Send Ad request with adRequstData
}

License

MIT

2.4.0

3 days ago

2.3.2

23 days ago

2.3.1

29 days ago

2.3.0

1 month ago

2.1.0

3 months ago

2.0.0

5 months ago

1.3.1

6 months ago

1.3.0

6 months ago

1.2.2

9 months ago

1.2.0

9 months ago

1.1.0

9 months ago