mobile_pos 0.3.2 mobile_pos: ^0.3.2 copied to clipboard
A Flutter plugin for Raven Bank's Mobile POS (BankBox) device.
Raven Bank Mobile POS (BankBox) Flutter Plugin #
A Flutter Plugin that enables you connect to Raven Bank’s Bank Box
Prerequisites #
Credentials #
First you need to obtain your app credentials from here
Android Setup #
Set minSdkVersion target #
This library targets android devices >= SDK 21. Make sure you're targeting at-least the same by modifying your android/app/build.gradle
file
minSdkVersion = 21
Update AndroidManifest.xml
to add neccessary permissions and configs #
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true" />
<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
Also Add this Activity to your AndroidManifest.xml
file #
<activity android:name="com.ravenpos.ravendspreadpos.device.RavenActivity"
android:exported="true">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
</activity>
Update styles.xml
Switch your theme parent to use
<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
IOS Setup #
Update Info.plist
to add neccessary permissions #
<key>NSBluetoothAlwaysUsageDescription</key>
<string>allow app use bluetooth</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>allow app use bluetooth</string>
<key>NSCameraUsageDescription</key>
<string>Can I use the camera please?</string>
Usage #
Import #
import 'package:mobile_pos/mobile_pos_sdk.dart';
Launch SDK #
await RavenBankBoxPlugin.launch(context,
config: BankBoxConfig(
showLabel: true,
theme: const MobilePOSTheme(
headerTextColor: Color(0xFF755AE2),
primaryColor: Color(0xFF755AE2),
onPrimary: Colors.white,
secondaryColor: Color(0xFFEA872D)),
enviroment: BankBoxEnviroment.staging,
appInfo: AppInfo(
appName: '<YOUR APP LABEL>',
appId: '<YOUR APP ID>',
appEmail: '<YOUR APP EMAIL>'),
customerInfo: CustomerInfo(
lastName: 'Raven',
firstName: 'Raven',
bvn: '<USER BVN>',
email: '<USER EMAIL>',
phone: '<USER PHONE NUMBER>',
),
onSuccess: (data) {
print(data);
},
onError: (error) {
print(error.message);
}));