# @essent/nativescript-iadvize

> iAdvize plugin for NativeScript.

Latest version **2.14.4** (published 2023-11-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @essent/nativescript-iadvize
pnpm add @essent/nativescript-iadvize
yarn add @essent/nativescript-iadvize
bun add @essent/nativescript-iadvize
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.14.4 |
| Published | 2023-11-28 |
| First published | 2021-08-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 54.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Essent |
| Maintainers | stefanipeters, jeroenverhoevenessent, thijsvanerp, vinodperumal01, dmestry, panagiotis.doxopoulos, nishanthessent, ekta123, icyrizard, thomasessent, melihkorkmaz, luukpook, svloon, spike1292, rik_bosch_essent, wvdkop-essent, sharanyasl, sreejanarayanankuttty, alihabib, geert.jan.evers, jimfranke1, ericpolman, areijngoudt, thijsbloks, sanjaikumarsankar, essent-mobile-app-team, jelle-tno, evelinevisee, jharskamp, m71629, frwielstra, joren-navara, thomas_smeele, btaluy, geert.rutten, vincentbitter, falcoworkstno, cdebruin, niek-essent, wesley.quintor, snorvisable, pcmulder, jphoiting, tomvoigt, lmeijdam, petervdwal, jboeijenga, essent-bot, vani.anandamurthy, jayanti88, dylankruyff, abhinandan.nasalapure.essent, pavandara, jeroenvanderlast, c.elshof, thedcsherman, lucashorward, hannahmauritz, dbeaart, tophernl, nimitha, markdanney, sridharsekar, mvlagen, emielvanrijn, n9iels, j.miletic, koengriffioenessent, geert-navara, davidfesten, lucaclae, ui929171, m.cetkovic, mleen, nielsvdhorst, stfnvar, walkerrunpdx |
| Keywords | NativeScript, JavaScript, TypeScript, iOS, Android |

## Links

- npm: https://www.npmjs.com/package/@essent/nativescript-iadvize
- Repository: https://github.com/Essent/nativescript-plugins
- Issues: https://github.com/Essent/nativescript-plugins/issues
- npm.io page: https://npm.io/package/@essent/nativescript-iadvize

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.14.4 (latest) — 2023-11-28
- 2.14.0-alpha1 (alpha) — 2023-10-27
- 2.3.0-beta.2 (beta) — 2022-10-28
- 2.14.3 — 2023-11-22
- 2.14.2 — 2023-11-17
- 2.14.1 — 2023-11-07
- 2.14.0 — 2023-10-31
- 2.13.1 — 2023-10-24
- 2.13.0 — 2023-10-02
- 2.13.0-alpha.1 — 2023-09-30
- 2.13.0-alpha.0 — 2023-09-30
- 2.11.6 — 2023-09-18
- 2.11.5 — 2023-09-11
- 2.10.1 — 2023-07-06
- 2.10.1-alpha.0 — 2023-07-06
- … 48 more at https://npm.io/package/@essent/nativescript-iadvize/versions

## README

# @essent/nativescript-iadvize

A NativeScript plugin for integration of iAdvize chat into Android/iOS app.

[![npm version](https://badge.fury.io/js/nativescript-iadvize.svg)](https://www.npmjs.com/package/@essent/nativescript-iadvize)

This is a plugin to show the conversation from a iAdvize chat, using the iAdvize SDK ([Android](https://github.com/iadvize/iadvize-android-sdk) v2.2.2, [iOS](https://github.com/iadvize/iadvize-ios-sdk) v2.2.5).

## Requirements

- iOS 12.0 or higher, and Xcode 12.5
- Minimum Android Version API 19, and Kotlin 1.5.10
- NativeScript CLI 7.x
- [iAdvize account](https://www.iadvize.com/)

## Installation

Run the following command from the root of your project:

```console
npm install @essent/nativescript-iadvize
```

### Activation

When the user logs in to the your app call `activate` with your credentials (our example [home.component.ts](./demo/src/app/home/home.component.ts)):

```ts
IAdvize.activate(XXXX, 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', 'userId', () => {
  console.log('IAdvize conversation activated.');
});
```

### Chatting

To open the chat window call `presentChat()`:

```ts
IAdvize.presentChat();
```

### Optional functions

#### Hide default chat button

To hide default chat button call `hideDefaultChatButton()`:

```ts
IAdvize.hideDefaultChatButton();
```

#### UI customization

To customize the chatbox UI call `customize()`:

```ts
const configuration: ChatConfiguration = {
  automaticMessage: 'Any question? Say Hello to Smart and we will answer you as soon as possible! 😊',
  font: 'fontPath',
  incomingMessageAvatar: 'avatar-icon',
  mainColor: '#4103fc',
  navigationBarBackgroundColor: '#4103fc',
  navigationBarMainColor: '#ffffff',
  navigationBarTitle: 'Chat Title',
};
IAdvize.customize(configuration);
```

#### Logging Out

To preserve the confidentiality of user conversation call `logout()`.

```ts
IAdvize.logout();
```

#### Conversation events

To add a listener to be informed in real time about conversation events call `registerConversationListener()`.

```ts
IAdvize.registerConversationListener(
  (url: string) => {
    console.log('Handle clicked url - ' + url);
    return false;
  },
  (hasOngoingConversation: boolean) => {
    console.log('Ongoing conversation status changed - ' + hasOngoingConversation);
  }
);
```

#### Push Notifications

To be informed of chat messages received when your app is not running call `registerPushToken()`

```ts
IAdvize.registerPushToken('your-token', isProduction);
```

---
_Source: https://npm.io/package/@essent/nativescript-iadvize · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
