Announcement Banners

Installation

To install the Quest react-native-sdk into your project, follow these steps:

  • Open your terminal/command prompt.

  • Navigate to your project's root directory using the cd command if you're not already there.

  • Run the following command to install the quest-sdk package using npm:

npm install @questlabs/react-native-sdk

This command will download and install the package and its dependencies into your project.

Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.

Usage

To integrate the Announcement_Banners component into your React native application, follow these steps

  • Import the Announcement_Banners Component: Import the Announcement_Banners component from the @questlabs/react-sdk package.

  • Import the QuestProvider Component: Import the QuestProvider component from the @questlabs/react-sdk package.

import { QuestProvider,Announcement_Banners} from '@questlabs/react-sdk';

Props of Announcement_Banners Component

The Announcement_Banners component accepts the following props

Props NameTypeRequireDetails

mainViewStyle

ViewStyle

optional

Main View Style

headerViewStyle

ViewStyle

optional

header View Style

headerTextStyle

TextStyle

optional

header Text Style

crossViewStyle

ViewStyle

optional

cross View Style

welcomeTextStyle

TextStyle

optional

welcome Text Style

middelViewStyle

ViewStyle

optional

middel View Style

descriptionTextStyle

TextStyle

optional

description Text Style

buttonViewStyle

ViewStyle

optional

button View Style

buttonTextStyle

TextStyle

optional

button Text Style

iconViewStyle

ViewStyle

optional

icon View Style

footerViewStyle

ViewStyle

optional

footer View Style

footerTextStyle

TextStyle

optional

footer Text Style

Example Usage

import { Button, Text, SafeAreaView, StyleSheet } from "react-native";
import React, { useState } from "react";
import {Announcement_Banners, QuestProvider} from "@questlabs/react-native-sdk";
export default function App() {
  return (
    <SafeAreaView style={styles.container}>
     <QuestProvider
        apiKey="Your-Api-Key"
        apiSecret="Your-Api-Secret"
        entityId="Your-entityId"
        />
      <Announcement_Banners 
       UserTitle={"Ashish"} 
       onClose={()=> {console.log("close")}}
       onShow={()=> {console.log("open")}}
      style={{
        mainViewStyle:{
          backgroundColor:'black',
        },
        welcomeTextStyle:{
          color:"yellow"
        },
        buttonViewStyle:{
          backgroundColor:"red"
        }
      }}
     </QuestProvider>
    
    </SafeAreaView>
  );
}
const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "lightgray",
    padding: 10,
    justifyContent: "center",
    alignItems: "center",
  },
});

Demo

Last updated