petro_sdk_package 0.0.2
petro_sdk_package: ^0.0.2 copied to clipboard
Petro Payment SDK
petro_sdk #
Put your app in front of everyone through their peers. Peer-to-peer invitations in a very subtle and simple way.
Getting Started #
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
Installation #
dependencies:
...
petro_sdk: ^0.0.2
Permissions #
Android #
Add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<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.BLUETOOTH_SCAN"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
iOS #
Set the following UsageDescription in your Info.plist file
<!-- Permission options for the `bluetooth` -->
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Need blutooth permission to handle background operation</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Need bluttoth permission when in use</string>
<!-- Permission options for the `location` group -->
<key>NSLocationWhenInUseUsageDescription</key>
<string>Need location when in use</string>
<!-- Permission options for the `NFC` -->
<key>NFCReaderUsageDescription</key>
<string>Please allow to read and write NFC</string>
<!-- Permission options for the `File manager` -->
<key>UISupportsDocumentBrowser</key>
<true/>
How to use. #
import petro_sdk.dart
import 'package:petro_sdk/petro_sdk.dart';
Example #
STEP: 1 #
Initialize PetroSdk with your appKey, appSecret, deviceId, phone and registered email address in main.dart file.
import 'package:flutter/material.dart';
import 'package:petro_sdk/petro_sdk.dart';
void main() {
PetroSdk.initialization(
context: context,
appKey: 'XXXXXXXXXXXXXXXXXXX',
appSecret: 'XXXXXXXXXXXXXX',
deviceId:'XXXXXXX',
email:'XXX@XXX.com',
phone:'+19999999999');
runApp(MyApp());
}