A react-native implementation/bridge of the helpscout-beacon package.
yarn add react-native-help-scout-beacon
The attachments menu for sending a message has code to allow users to take a photo or select one from their photo library. Even if you have attachments disabled, Apple flags usage of these APIs; so, it requires a description string in the app’s Info.plist
file.
The required settings are NSPhotoLibraryUsageDescription
, NSCameraUsageDescription
, NSMicrophoneUsageDescription
and NSPhotoLibraryAddUsageDescription
.
To access the documents picker in the attachment menu you must create an iCloud container that matches your app’s bundle ID.
If you do not already have push notifications active in your application, you may receive a warning when uploading to App Store Connect. Similar to Photos, App Store Connect flags usage of these APIs in code independent of whether you invoke them or not. To support push notifications, perform the following setup:
- When the app starts up, initialize the notification system for Beacon by calling
HSBeacon.initializeBeaconPushNotificationSupport()
(imported from the Beacon module) - When failed to register to remote notifications let Beacon knows by calling
HSBeacon.failedToRegisterForRemoteNotificationsWithError(error)
. - When successfully received a push token, you can set it natively by calling
HSBeacon.setDeviceToken(token)
or using the JS methodBeacon.registerPushNotificationToken(token)
. - Add the following to your
application:didReceiveRemoteNotification
for correctly handling incoming push notifications:
if HSBeacon.isBeaconPushNotification(userInfo) {
HSBeacon.handlePushNotification(userInfo, beaconSettings: settings)
}
-
When successfully received a push token, you can set it natively by calling
Beacon.setFirebaseCloudMessagingToken(token)
or using the JS methodBeacon.registerPushNotificationToken(token)
. -
Add the following to your
onMessageReceived(RemoteMessage)
for correctly handling incoming push notifications:
@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData().size() > 0) {
BeaconPushNotificationsProcessor beaconPushNotificationsProcessor = new BeaconPushNotificationsProcessor()
if (BeaconPushNotificationsProcessor.isBeaconNotification(remoteMessage.getData())) {
beaconPushNotificationsProcessor.process(this, remoteMessage.getData());
} else {
// here can process your own push messages
}
}
}
import Beacon from 'react-native-help-scout-beacon';
// ...
Beacon.open({ beaconId: '<beacon_id>' });
- Open
- Normal Mode
- Safe Mode
- Authenticate Users
- User attributes
- Logout
- Session attributes
- Contact form
- Prefilling
- Attachments
- Custom fields
- Resetting
- Prefilling
- Navigate to a screen
- Open with search results
- Open to an article
- Open to the contact form
- Previous messages
- Open chat
- Open ask
- Custom Suggestions
- Open and close events
- Push Notifications
- Open
- Normal Mode
- Safe Mode
- Authenticate Users
- User attributes
- Logout
- Session attributes
- Contact form
- Prefilling
- Attachments
- Custom fields
- Resetting
- Prefilling
- Navigate to a screen
- Open with search results
- Open to an article
- Open to the contact form
- Previous messages
- Open chat
- Open ask
- Custom Suggestions
- Open and close events
- Push Notifications
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT