Installing the SDK
The SDK is designed to work with iOS 10 and up. To install the SDK via CocoaPods, use the following instructions. To install the SDK manually, see these instructions.
Installing the SDK via CocoaPods
Put this in your
Podfile
and then run
pod install
:
source 'https://github.com/CocoaPods/Specs.git' source 'https://bitbucket.org/payworks/io.payworks.repo.pods.git' use_frameworks! target :"<your-app-target>" do pod 'payworks', '2.39.1' end
Additional Step for Bluetooth Devices
s
For a Bluetooth device, such as a Miura card reader, to connect as an external accessory and to be able to receive messages while the app is in the background, add additional entries to your
Info.plist
:
  • Key: Supported external accessory protocols (
    UISupportedExternalAccessoryProtocols
    ), Value:
    com.miura.shuttle
    –- for Miura readers.
  • Key: Required background modes (
    UIBackgroundModes
    ), Value: App communicates with an accessory (
    external-accessory
    )
Then, import the framework in your header file:
#import <mpos_core/mpos_extended.h>
You can now implement your first transaction workflow.
Installing the SDK
The SDK is designed to work with Android 5 and up. To install the SDK via our Gradle repository, use the following steps. To install the SDK manually, see the instructions here.
Installing the SDK Via Gradle
Add our repository to your
project's
build.gradle
:
allprojects { repositories { jcenter() maven { url "http://releases.payworks.io/artifactory/mpos" } } }
For version
2.45.0
and above, make sure the app support Java 8 features by setting the compatibility levels:
android{ ... compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } }
Add the following exclusion rules to your module's
build.gradle
(inside the Android section):
packagingOptions { exclude 'META-INF/*' exclude 'LICENSE.txt' exclude 'asm-license.txt' }
Add the libraries to the dependencies section of your module's
build.gradle
:
dependencies {implementation 'io.payworks:mpos.android.core:2.47.4' // Add these three dependencies if you want to use a Miura card reader implementation 'io.payworks:mpos.java.accessories.miura:2.47.4' implementation 'io.payworks:mpos.android.comlinks.bluetooth:2.47.4:@aar' implementation 'io.payworks:mpos.java.comlinks.tcp:2.47.4' // Add these two dependencies if you want to use a Verifone card reader implementation 'io.payworks:mpos.java.accessories.vipa:2.47.4' implementation 'io.payworks:mpos.java.comlinks.tcp:2.47.4' }
If you want to use ProGuard with your application, make sure to add the necessary rules to your ProGuard configuration.
Make sure to update your
AndroidManifest.xml
to enable a larger heap size by setting
android:largeHeap="true"
. This setting is required to accommodate situations in which an update of the terminals is required and bigger chunks of data are requested and transferred.
<application [...] android:largeHeap="true"> [...] </application>