# io-smooch-smcordovaplugin

> Smooch Cordova Plugin for iOS and Android

Latest version **1.1.5** (published 2015-11-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install io-smooch-smcordovaplugin
pnpm add io-smooch-smcordovaplugin
yarn add io-smooch-smcordovaplugin
bun add io-smooch-smcordovaplugin
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2015-11-02 |
| First published | 2015-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Smooch |
| Maintainers | edwardc |
| Keywords | Smooch, messaging, chat, in-app, support, help, ecosystem:cordova |

## Links

- npm: https://www.npmjs.com/package/io-smooch-smcordovaplugin
- Repository: https://github.com/smooch/smooch-cordova
- Homepage: https://github.com/smooch/smooch-cordova#readme
- Issues: https://github.com/smooch/smooch-cordova/issues
- npm.io page: https://npm.io/package/io-smooch-smcordovaplugin

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.1.5 (latest) — 2015-11-02

## README

# Maintenance
This repository is no longer being maintained. If you actively use this and want to become a maintainer let us know at help@smooch.io.

# smooch-cordova
Cordova (PhoneGap) bindings for [Smooch](https://smooch.io).

# Basic Setup

## Install Smooch

For iOS: [http://docs.smooch.io/#manual-method](http://docs.smooch.io/#manual-method)

For Android: Gradle does the work for you!

## Install Cordova plugin

cordova plugin add smooch-cordova

You should now see smooch-cordova.js and the SmoochCordova source files in your project directory.

## Init Smooch with appId

### iOS

In your javascript:

```js
Smooch.init({
  	"appId" : "your-smooch-app-id",
  	"conversationAccentColor" : "#FFFFFF" // optional, default is #00B0FF
});
```

**IMPORTANT**: This call must be made **AFTER** the `deviceready` event of Cordova.

See [http://docs.smooch.io/api/ios/Classes/SKTSettings.html](http://docs.smooch.io/api/ios/Classes/SKTSettings.html) for other init settings.

### Android

In `io.smooch.cordova.SmoochApplication.java`, change `<your_app_id>` to your app id. This file is located inside the `src` folder of the android project.

Locate the file called AndroidManifest.xml in the root of your Android project. Inside the `<application>` tag, add `android:name="io.smooch.cordova.SmoochApplication"`

That's it!
See [http://docs.smooch.io/api/android/](http://docs.smooch.io/api/android/) for other init settings.

To enable push notifications, follow the docs [here](http://docs.smooch.io/android/#configuring-push-notifications).

## Show Smooch

Now, you're ready to show the Smooch chat window.

```js
Smooch.show();
```

# Awesome Setup

## Add user info

```js
Smooch.setUser({
	"firstName" : "Erlich",
	"lastName" : "Bachman",
	"email" : "erlich.bachman@aviato.com",
	"signedUpAt" : 1397606400000 // unix timestamp in milliseconds
});
```
## Add custom user properties

```js
Smooch.setUserProperties({
	"tv_show" : "Silicon Valley",
	"episodes" : "Server Space, The Lady, Bad Money",
	"net_worth" : 1000000
});
```

## Login

With JWT:
```js
Smooch.login("userId", "jwt");
```

Without:
```js
Smooch.login("userId");
```

# Common errors

If you stumble upon this error when building for android:
```
Error: /yourapp/platforms/android/gradlew: Command failed with exit code 1 Error output:
/yourapp/platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

/yourapp/platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

FAILURE: Build failed with an exception.
```

Make sure to set the target to `android-26` in `platforms/android/project-properties`

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