leegeunhyeok / react-native-zendesk-messaging

šŸ—£ļø Zendesk messaging SDK for React Native
https://www.npmjs.com/package/react-native-zendesk-messaging
MIT License
37 stars 10 forks source link
android ios react-native zendesk
# react-native-zendesk-messaging zendesk [Zendesk messaging SDK](https://developer.zendesk.com/documentation/zendesk-web-widget-sdks) for React Native [![style](https://img.shields.io/badge/vercel%20code--style-000000?logo=vercel&logoColor=white)](https://github.com/vercel/style-guide) [![ktlint](https://img.shields.io/badge/ktlint%20code--style-%E2%9D%A4-FF4081)](https://pinterest.github.io/ktlint) [![swiftlint](https://img.shields.io/badge/swiftlint%20code--style-%E2%9D%A4-51A0D5)](https://github.com/realm/SwiftLint) [![npm version](https://badge.fury.io/js/react-native-zendesk-messaging.svg)](https://badge.fury.io/js/react-native-zendesk-messaging)

Features

Read official announcement about new messaging SDKs here.

Installation

npm install react-native-zendesk-messaging
# or
yarn add react-native-zendesk-messaging

Getting Started

Read Getting Started Guide.

Usage

import React, { useEffect } from 'react';
import {
  StyleSheet,
  SafeAreaView,
  Pressable,
  Text
} from 'react-native';
import * as Zendesk from 'react-native-zendesk-messaging';

const CHANNEL_KEY = 'YOUR_ZENDESK_CHANNEL_KEY';

function App() {
  useEffect(() => {
    Zendesk.initialize({ channelKey: CHANNEL_KEY })
      .then(() => /* success */)
      .catch((error) => /* failure */);
  }, []);

  const handlePressOpenButton = () => {
    Zendesk.openMessagingView();
  };

  return (
    <SafeAreaView style={styles.container}>
      <Pressable onPress={handlePressOpenButton}>
        <Text>Open Messaging</Text>
      </Pressable>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

For more details, Read the API References.

If you're interested in contributing, check out the Contributing Guide.

Contributing

See CONTRIBUTING.md.

License

MIT


Made with create-react-native-library