npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@centiongroup/chat-sdk

v0.0.3

Published

A comprehensive Mobile SDK for integrating Cention's real-time communication and collaboration features into mobile applications. This SDK enables developers to effortlessly incorporate chat, voice, and video functionalities, alongside advanced collaborat

Downloads

18

Readme


  ____ _____ _   _ _____ ___ ___  _   _   ____  ____  _  __
 / ___| ____| \ | |_   _|_ _/ _ \| \ | | / ___||  _ \| |/ /
| |   |  _| |  \| | | |  | | | | |  \| | \___ \| | | | ' / 
| |___| |___| |\  | | |  | | |_| | |\  |  ___) | |_| | . \ 
 \____|_____|_| \_| |_| |___\___/|_| \_| |____/|____/|_|\_\

Cention Chat SDK for Mobile Apps

Version 0.1

--/--/----

Requirements:

• The current Chat SDK can only be integrated in React native Apps.

• The Chat SDK support react native version -.--- .

Integrating Cention Chat SDK in Your App:

To integrate the Cention Chat SDK into your application, you'll need to configure the chat widget with specific parameters. Below is an example of how you can set up the integration:

<ChatModal workSpace={'worspace_name'} widgetId={widgetId_number} customization={false} />
  • workSpace: Specifies the workspace or domain associated with your Cention account. In the provided example, it's set to 'workspace_name'. You'll need to replace 'workspace_name' with the respective workspace.
  • widgetId: Represents the unique identifier of the chat SDK or configuration within your Cention Contact Center account. Here, it's set to 'widgetId_number'. Replace 'widgetId_number' with the appropriate widget ID.
  • customization: A boolean value indicating whether customization options for the chat SDK are enabled {true} or disabled {false}. In this example, it's set to {false}, meaning customization is disabled. Adjust this value based on your customization preferences.

ChatSDK Customization Guide:

Screenshots given is the guide to use the customization in an efficient way.

Your paragraph text (2) Your paragraph text (1)

Local Notifications Setup Guide (optional):

Prerequisites

• React Native environment set up

• react-native-push-notification package installed

• Android Studio and the Android SDK

Installation and Configuration

To enable local notifications in your React Native app, follow these steps to install and configure the necessary library.

Step 1: Install the Library

Run the following command in your React Native project directory:

npm install --save react-native-push-notification

or if you use Yarn:

yarn add react-native-push-notification

Step 2: Android Configuration

Modify your AndroidManifest.xml to include the necessary permissions and receivers:

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application ...>
    <meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="false"/>
    <meta-data android:name="com.dieam.reactnativepushnotification.notification_color" android:resource="@color/white"/>
    
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" android:exported="true"/>
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" android:exported="true"/>
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver" android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED"/>
        </intent-filter>
    </receiver>
</application>

Create a Notification Icon

Add a notification icon to your drawable folders. This icon should be a white shape on a transparent background. You might need different sizes for different resolutions (hdpi, mdpi, xhdpi, xxhdpi, xxxhdpi).

Make sure to define the notification color in your res/values/colors.xml:

<resources>
    <color name="white">#FFFFFF</color>
</resources>

Step 3: Initialize Notification Channels

Before triggering local notifications, initialize the notification channel as early as possible in your app's lifecycle, such as in your App.js:

import PushNotification from 'react-native-push-notification';

   PushNotification.createChannel({
    channelId: "incoming-message",
    channelName: "Incoming Messages",
    channelDescription: "Notifications for new messages",
    playSound: true, // Whether to play a sound or not
    soundName: "default", // The sound to play (default system sound)
    importance: 4, // Importance level (4 is high importance, makes sound and shows as a popup)
    vibrate: true, // Whether the phone should vibrate
  }, (created) => console.log(`CreateChannel returned '${created}'`));

Integrating Notification Service in Cention Chat SDK

Define a notification service that will be used by the Cention Chat SDK to trigger notifications:

import notificationService from './notificationService';

ChatSDK.initialize({
  // SDK configuration
  notificationService: notificationService,
});

Triggering a Local Notification

Here's an example function to trigger a local notification:

// notificationService.js
import PushNotification from 'react-native-push-notification';

// Initialize and create channels outside of the showNotification function

const notificationService = {
  showNotification: (title, message) => {
    // Directly use the channel to show the notification
   PushNotification.localNotification({
      channelId: "incoming-message", // Match the channel ID
      title: title, // The title of the notification
      message: message, // The message of the notification
      bigText: message, // Same as message, but can be longer
      subText: "Tap to open", // Subtext shown below the message on newer Android versions
      color: "blue", // Accent color (Android 5.0+)
      smallIcon: "ic_notification", // Small icon shown in the status bar and on the left of the notification (must be a white PNG in your drawable resources)
      largeIcon: "ic_launcher", // Large icon shown on the right of the notification (optional)
      largeIconUrl: "https://example.com/path/to/image.png", // URL to fetch a large icon (optional)
      vibrate: true, // Whether to vibrate
      vibration: 300, // Vibration pattern or duration in milliseconds
      playSound: true, // Whether to play a sound
      soundName: "default", // Sound to play (use 'customsound.mp3' for custom sounds located in '/android/app/src/main/res/raw')
      actions: '["Yes", "No"]', // Android action buttons in JSON format
      // Additional properties...
    });
  },
};



export default notificationService;

For further customization and additional settings, refer to the react-native-push-notification documentation.

Questions:

If you have any questions regarding the customizations process feel free to ask your excellent support team at which you can reach by emailing [email protected].