Coder Social home page Coder Social logo

leocp / announcekit-react-native Goto Github PK

View Code? Open in Web Editor NEW

This project forked from announcekitapp/announcekit-react-native

1.0 0.0 0.0 453 KB

AnnounceKit Widget React Native Wrapper

Home Page: https://announcekit.app

License: MIT License

Shell 18.20% TypeScript 81.80%

announcekit-react-native's Introduction

AnnounceKit react-native sdk

AnnounceKit Widget React Native Wrapper

screenshot

Example

Live: https://snack.expo.dev/@amiralin/announcekit-widget

Code Sample

function App() {
  return (
    <SafeAreaView style={styles.container}>
      <AnnounceKitProvider widget="https://announcekit.co/widgets/v2/4c6CdO">
        <WidgetButton/>
      </AnnounceKitProvider>
    </SafeAreaView>
  );
}

function WidgetButton() {
  const unread = useUnreadCount();
  const [openWidget] = useWidget();

  if (typeof unread === 'undefined') return null;

  return (
    <Button title={`${unread} unread posts`} onPress={(e) => openWidget()}></Button>
  );
}

##Installation

npm install announcekit-react-native 

Also install react-native-webview because it's a dependency for this package

npm install add react-native-webview

Note: if you are on iOS, you will need this extra step: Install the native dependencies with Cocoapods

cd ios && pod install

Documentation

Props and Methods

//props:
export interface AnnounceKitProps {
  widget: string;
  lang?: string;
  user?: {
    id: string | number;
    name?: string;
    email?: string;
  };
  data?: {
    [key: string]: any;
  };
  user_token?: string;
  labels?: string[];
  children?: React.ReactNode;
}


//methods
useUnreadCount(): number | undefined
useWidget(): [open(), close()]

FAQ

If you have any questions contact https://announcekit.app or use Issues.

announcekit-react-native's People

Contributors

eknkc avatar leocp avatar namirali avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.