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-code7-boteria-widget

v1.0.0

Published

A agile and efficient way to integrate chat functionality (Boteria) into your React Native applications.

Downloads

128

Readme

Boteria Mobile 🤖

Uma maneira ágil e eficiente de integrar a funcionalidade de chat (Boteria) em seus aplicativos React Native


Instalação

yarn add -D react-native-code7-boteria-widget [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] @miblanchard/[email protected]

Importação

import { View } from 'react-native';
import { Code7Boteria } from 'react-native-code7-boteria-widget';

// ...

return (
  <View>
    <Code7Boteria botId="botId" />
  </View>
);

Exemplo para envio de parãmetros adicionais no início da conversa:

const params = { foo: 'bar' };

return (
  <View>
    <Code7Boteria
      botId="botId"
      params={params}
    />
  </View>
)

Também é possível substituit o widget flutuante por um componente pressionável de sua aplicação ao passá-lo como children, por exemplo:

return (
  <View>
    <Code7Boteria botId="botId">
      <Button title="Abrir o chat" />
    </Code7Boteria>
  </View>
)

Ou então:

return (
  <View>
    <Code7Boteria
      botId="botId"
      children={<Button title="Abrir o chat" />}
    >
  </View>
)

Lembre-se de substituir 'botId' pelo identificador correto do seu BOT.

Para versões React Native 0.64.0 até 0.70

yarn add @react-native/normalize-color

Acesso ao Ambiente de Homologação

Para acessar o ambiente de homologação do aplicativo, você precisará passar o parâmetro staging como true. Por exemplo:

<Code7Boteria staging botId="MEU_ID" />

Ao fazer isso, o ambiente do aplicativo será redirecionado para a homologação ao invés do ambiente padrão de produção.

Configuração react-native-video

android/settings.gradle

include ':react-native-video'
project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android-exoplayer')

android/gradle.properties

android.useAndroidX=true
android.enableJetifier=true

MyApplication.java No topo, onde estão as importações:

import com.brentvatne.react.ReactVideoPackage;

Adicione a classe ReactVideoPackage à sua lista de pacotes exportados.

packages.add(new ReactVideoPackage());

Suporte para GIFs

android/app/build.gradle

implementation "com.facebook.fresco:animated-base-support:1.3.0"
implementation "com.facebook.fresco:animated-gif:2.5.0"

Suporte para Notificações

android/app/src/main/AndroidManifest.xml

Dentro da tag manifest, adicione:

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

Dentro da tag application, adicione:

<provider
  android:name="androidx.core.content.FileProvider"
  android:authorities="${applicationId}.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/file_paths" />
</provider>

android/app/src/main/res/xml/file_paths.xml

<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="my_files" path="." />
    <external-path name="external_files" path="." />
    <external-files-path name="external_files" path="." />
    <root-path name="root" path="." />
    <root-path name="external_storage_root" path="/storage/" />
    <root-path name="external_downloads" path="/storage/emulated/0/Downloads/" />
</paths>

Parâmetros

{
  foo: 'bar'
}
<MyComponent />
{
  title: 'Bot title',
  settings: {
    botFab: 'https://my-domain/my-icon.png',
    mainColor: '#FF0000',
    mainTextColor: '#00FF00',
    secondaryColor: '#000000',
    secondaryTextColor: '#0000FF',
  },
}