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

react-native-wannatalk-core

v1.1.0

Published

TODO

Downloads

113

Readme

react-native-wannatalk-core

Getting started

$ npm install react-native-wannatalk-core --save

Mostly automatic installation

$ react-native link react-native-wannatalk-core

iOS Setup

  1. Request WTService-Info.plist from wannatalk.ai and drag it into your application. When prompted, select "Copy items if needed" and continue.

  2. Add below keys in your application's Info.plist

    <key>NSPhotoLibraryUsageDescription</key>
    <string>To save in-chat photos and videos</string>
    <key>NSContactsUsageDescription</key>
    <string>To locate friends already on the Wannatalk network</string>
    <key>NSCameraUsageDescription</key>
    <string>To take photos and videos to send to friends in-chat</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>To display it in map</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>To record live photos and movies</string>
  3. Add this line to your pod file

    pod 'WTExternalSDK', :git =>'https://github.com/edzehoo/WannatalkAPI-iOS.git', :tag => '1.5.1'

  4. $ cd ios && pod install && cd ..

  5. $ react-native run-ios

To strip simulator architecture framework for your app submission

  1. Copy trim.sh file into your project folder.
  2. Create Run Script Phase in Build Phases of your application target.
  3. Paste "$SRCROOT/trim.sh" inside the body of Run Script Phase.
  4. Enable Run script only when installing and Show environment variables in build log.

Android Setup

  1. Request wannatalk-services.json from wannatalk.ai and drag it into your application assets directory
  1. Set compileOptions in your application build.gradle
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    ...
}
  1. Enable multiDexEnabled in your application build.gradle

    android {
        defaultConfig {
            // Enabling multidex support.
            multiDexEnabled true
        }
        ...
    }
  2. Set colorPrimary, colorPrimaryDark and colorAccent attributes in app's color.xml (src/main/res/values/colors.xml)

  3. $ react-native run-android

Usage

import WannatalkCore from 'react-native-wannatalk-core';
import { NativeEventEmitter, NativeModules } from 'react-native'

const WannatalkCoreEmitter = new NativeEventEmitter(WannatalkCore)

To link Wannatalk account

WannatalkCore.silentLogin("<user_identifier>", { displayname: "name", key1: "Value1", key2: "Value2"}, (success, error) => {
});

Login events

componentDidMount() {
  this.loginSubscription = WannatalkCoreEmitter.addListener('login-event', (data) =>  {
    // this.setState({loggedIn: data.userLoggedIn});  
  })
}

To check login status

WannatalkCore.isUserLoggedIn((userLoggedIn) => {
  // this.setState({loggedIn: data.userLoggedIn});  
})

To unlink Wannatalk account

WannatalkCore.logout((success, error) => {
});

HelpDesk

To load your organization profile

WannatalkCore.loadOrganizationProfile(true, (success, error) => {
});

Collaboration

To view all chats

WannatalkCore.loadChatList(, (success, error) => {
});

To view all users

WannatalkCore.loadUsers(, (success, error) => {
});

Other

To show or hide guide button

WannatalkCore.ShowGuideButton(true); // default = true

To enable or disable sending audio message

WannatalkCore.AllowSendAudioMessage(false);  // default = YES

To show or hide add participants option in new ticket page and chat item profile page

WannatalkCore.AllowAddParticipants(false);    // default = YES

To show or hide remove participants option in chat item profile

WannatalkCore.AllowRemoveParticipants(false); // default = NO

To show or hide welcome message

WannatalkCore.ShowWelcomeMessage(false);            // default = NO

To show or hide Profile Info page

WannatalkCore.ShowProfileInfoPage(false);           // default = YES

To create auto tickets:

Chat ticket will create automatically when auto tickets is enabled, otherwise default ticket creation page will popup

WannatalkCore.EnableAutoTickets(true);           // default = NO

To show or hide close chat button in chat page

WannatalkCore.ShowExitButton(true);               // default = NO

To show or hide participants in chat profile page

WannatalkCore.ShowChatParticipants(false);          // default = YES

To enable or disbale chat profile page

WannatalkCore.EnableChatProfile(false);           // default = YES

To allow modify in chat profile page

WannatalkCore.AllowModifyChatProfile(false);       // default = YES

To set Inactive chat timeout:

Chat session will end if user is inactive for timeout interval duration. If timeout interval is 0, chat session will not end automatically. The default timout interval is 1800 seconds (30 minutes).

let timeoutInterval = 1800; // Default Value: 1800 seconds ~ 30 minutes
WannatalkCore.SetInactiveChatTimeoutInterval(timeoutInterval);