react-native-mpos-native

3.4.3 • Public • Published

Getting started

First, you need to clone the repo and install dependencies:

$ yarn add react-native-mpos-native
$ react-native link react-native-mpos-native

Android setup

You must confirm that ./android/build.gradle has the following configuration:

allProjects {
  repositories {
	  // ...
	  maven {
	    url "https://dl.bintray.com/vivareal/maven"
	  }
	  flatDir {
	    dirs "$rootDir/../node_modules/react-native-mpos-native/android/libs"
	  }
  }
}

Then inside of ./android/app/build.gradle add:

dependencies {
  // ...
  implementation 'br.com.vivareal:cuid-android:0.1.0'
}

Then inside of ./android/app/src/main/AndroidManifest.xml add:

xmlns:tools="http://schemas.android.com/tools" tools:replace="android:allowBackup"

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  package="com.package">

	<application 
	  ...
      android:allowBackup="false"
      tools:replace="android:allowBackup"
	>
	</application>
</manifest>

Then inside of ./android/app create a folder libs if not exists. Copy files: mpos-android.native.jar and mpos-android.aar from /appFolder/node_modules/react-native-mpos-native/android/libs/

Rebuild project

iOS

  1. Required iOS 10.3 or later.

  2. Install Pods.

$ cd ios/
$ pod install
  1. Open your iOS project workspace on XCode.

  2. Add MposSDK.framework and Result.framework in Frameworks, Libraries, and Embedded Content. Use the node_modules reference ./node_modules/react-native-mpos-native/ios/libs to drag to the project.

  3. Add "$(SRCROOT)/../node_modules/react-native-mpos-native/ios/libs" in Build Settings > Framework Search Paths.

  4. Set Enable Bitcode to No.

Basic Usage

Pinpad/Mpos

The simplest usage was 'quite' documented on https://github.com/pagarme/pinpadRNExample/blob/master/src/screens/DeviceDetails/index.js

Bluetooth

The simplest usage was 'quite' documented on https://github.com/pagarme/pinpadRNExample/blob/master/src/screens/BluetoothDevices/index.js

Example

Example of use https://github.com/pagarme/pinpadRNExample

To run the example:

$ yarn

Android

$ yarn run android

iOS

$ cd ios/
$ pod install
$ cd ..
$ yarn run ios

Readme

Keywords

Package Sidebar

Install

npm i react-native-mpos-native

Weekly Downloads

3

Version

3.4.3

License

MIT

Unpacked Size

13.8 MB

Total Files

122

Last publish

Collaborators

  • pagarme-opensource
  • matheusvellone
  • lucianopf
  • marquinhoalm
  • zignd
  • asamedeirospagarme
  • cigoli
  • geraldofada-pagarme
  • gabilleone
  • ramonpaolo-pagarme
  • davidsmedeiros
  • andre.lsilva
  • bruno.mduarte
  • nathaliacrelier
  • jonasnt17
  • danielponde
  • joaovjs-pagarme
  • rpsantos1987
  • prifight
  • carolinaaguelera
  • gabrielpagarme
  • magnomoreira