https://github.com/codemotionapps/react-native-help-scout
Help Scout's Beacon for React Native
https://github.com/codemotionapps/react-native-help-scout
android ios react react-native typescript
Last synced: 2 months ago
JSON representation
Help Scout's Beacon for React Native
- Host: GitHub
- URL: https://github.com/codemotionapps/react-native-help-scout
- Owner: codemotionapps
- License: mit
- Created: 2019-09-22T18:56:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-04T15:05:49.000Z (about 2 years ago)
- Last Synced: 2025-08-08T22:25:32.073Z (3 months ago)
- Topics: android, ios, react, react-native, typescript
- Language: Java
- Size: 409 KB
- Stars: 6
- Watchers: 4
- Forks: 14
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Native Help Scout
[](https://www.npmjs.com/package/react-native-help-scout)
[](http://makeapullrequest.com)
Help Scout's Beacon for React Native.
## Installation
```sh
yarn add react-native-help-scout
```
### iOS
Please visit https://developer.helpscout.com/beacon-2/ios/#additional-setup and complete the steps
## Usage
```javascript
import { Beacon } from 'react-native-help-scout'
// Initialize Beacon
Beacon.init('beacon-id')
// Open Beacon
Beacon.open()
// Open Beacon Secure mode
Beacon.open(signature)
// Set user information in Beacon
Beacon.identify({
email: 'joshuaheywood@live.com',
name: 'Joshua Heywood',
company: 'Megatronic',
jobTitle: 'Marketing Manager',
})
// Unset user information in Beacon
Beacon.logout()
// Navigate to a specific screen (iOS only)
Beacon.navigate('/ask/message/')
// Open with search
Beacon.search('query')
// Open article
Beacon.openArticle('DOCS_ARTICLE_ID')
// Open contact from
Beacon.contactForm()
// Open previous messages (Android only)
Beacon.previousMessages()
// Dismissing the Beacon (iOS only)
Beacon.dismiss(() => console.log('Beacon dismissed'))
// Event handlers
const openHandler = () => console.log('Beacon opened')
Beacon.events.on('open', openHandler)
Beacon.events.off('open', openHandler)
Beacon.events.off('open')
Beacon.events.once('open', () => console.log('This will only get called the first time the open event is triggered'))
const closeHandler = () => console.log('Beacon closed')
Beacon.events.on('close', closeHandler)
Beacon.events.off('close', closeHandler)
Beacon.events.off('close')
Beacon.events.once('close', () => console.log('This will only get called the first time the close event is triggered'))
```
## Requirements
- React Native 0.61.0 or newer