0.2.3 • Published 2 years ago

react-native-prisma-campaigns v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

react-native-prisma-campaigns

Prisma Campaigns integration for React Native apps.

This Library is a brigde with Prisma's Android SDK and iOS SDK.

Installation

npm install react-native-prisma-campaigns react-native-webview

react-native-webview is required for rendering HTML banners.

Android

You need to add the Prisma SDK dependency on you project's gradle file. You can use the aar file bundled with this package:

  implementation files("../../node_modules/react-native-prisma-campaigns/android-prisma-sdk/prisma-sdk.aar")

Or download the .AAR library and reference the downloaded file.

iOS

No further configuration required.

Usage

Before starting to show Prisma banners, you need to call the PrismaLoad method:

import { PrismaLoad } from 'react-native-prisma-campaigns';

// ...

export default function App() {

    const PRISMA_URL: string         = "<YOUR PRISMA URL>"
    const PRISMA_PORT: string        = "<PORT>" 
    const PRISMA_APP_TOKEN: string   = "<YOUR_APPTOKEN>" 
    const PRISMA_CUSTOMER_ID: string = "<CUSTOMER_ID>"

    PrismaLoad(PRISMA_URL, PRISMA_PORT, PRISMA_APP_TOKEN, PRISMA_CUSTOMER_ID);
//...
ParametersDescriptionExample
PRISMA_URLThis is the URL to you Prisma instance'university.prismacampaigns.com'
PRISMA_PORTThe port used by you Prisma instance'443'
PRISMA_APP_TOKENYou application token configured on Prisma'00000-000-0000-00-00000000000'
PRISMA_CUSTOMER_IDThe Customer ID requesting campaigns (empty string('') if is annonymous)'CustomerName'

Once you initialized the library, you can start displaying the banners You need to use the UI component *PrismaPlaceholder* for rendering the banners:

//...

 return (
    <PrismaPlaceholder style={styles.placeholderStyles} placeholderName='PrismaPlaceholderName'/>
  );
}

Where the property placeholderName is the name of the placeholder configured on Prisma.

TO DO:

  • Test interoperability with Jumio SDK (Android)
  • Support multiple campaigns in a single placeholder (Android)

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.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago