capacitor-brightsdk
v0.0.6
Published
Capacitor BrightSDK plugin (unofficial) enable [Capacitor](https://capacitorjs.com/) based apps to interact with the [Bright SDK](https://bright-sdk.com).
Maintainers
Readme
Capacitor BrightSDK
Overview
Capacitor BrightSDK plugin (unofficial) enable Capacitor based apps to interact with the Bright SDK.
Installation
To install the BrightSDK plugin, use the Capacitor CLI:
npm i EdenwareApps/capacitor-brightsdk
After that, you should put bright_sdk.aar file under android/app/libs/.
Example Usage
const sdk = plugins.BrightSDK;
sdk.init({
trackingId: 'your_tracking_id',
tosLink: 'http://example.com/tos',
logoLink: 'http://example.com/logo.png',
bgColor: '#FFFFFF',
btnColor: '#FF0000',
txtColor: '#000000',
txtCulture: 'en-US',
appName: 'My App'
}).then(() => {
// BrightSDK initialized
// Enable BrightSDK
const forceDialogShowing = true
sdk.enable(forceDialogShowing).then(() => {
console.log('BrightSDK enabled');
// Disable BrightSDK
sdk.disable().then(() => {
console.log('BrightSDK disabled');
}).catch(error => {
console.error('Disabling failed:', error);
});
}).catch(error => {
console.error('Enabling failed:', error);
});
}).catch(error => {
console.error('Initialization failed:', error);
});
// Registering and handling events
const listener = choice => {
/*
0 => No choice yet.
1 => User accepted and is now a peer.
2 => User did not accepted and not a peer.
*/
console.log('Choice received:', choice);
}
sdk.on('choice', listener);
// sdk.off('choice', listener);Notes
Refer to the BrightSDK documentation for detailed information on available config options for the init method. For further assistance, contact the plugin developer.
