Installing the SDK
The SDK is designed to work with iOS 10 and higher. Use these instructions to install the SDK via CocoaPods. To install the SDK manually, use 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://github.com/visa/mpos.sdk.ios.pods.git' use_frameworks! target :"<your-app-target>" do pod 'payworks', '2.65.0' end
Additional Step for Bluetooth Devices
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)
You can now implement your first transaction workflow.#import <mpos_core/mpos_extended.h>
Installing the SDK
The SDK is designed to work with Android 5 and higher. To install the SDK via our Gradle repository, use these instructions. To install the SDK manually, see these instructions.
Installing the SDK via Gradle
build.gradle
:
For version 2.45.0 and above, make sure the app support Java 8 features by setting the compatibility levels:allprojects { repositories { jcenter() maven { url "https://repo.visa.com/mpos-releases/" } } }
Add the following exclusion rules to your module'sandroid{ ... compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 } }
build.gradle
(inside the Android section):
Add the libraries to the dependencies section of your module'spackagingOptions { exclude 'META-INF/*' exclude 'LICENSE.txt' exclude 'asm-license.txt' }
build.gradle
:
dependencies {implementation 'io.payworks:mpos.android.core:2.95.0' // Add these three dependencies if you want to use a Miura card reader implementation 'io.payworks:mpos.java.accessories.miura:2.95.0' implementation 'io.payworks:mpos.android.comlinks.bluetooth:2.95.0:@aar' implementation 'io.payworks:mpos.java.comlinks.tcp:2.95.0' // Add these two dependencies if you want to use a Verifone card reader implementation 'io.payworks:mpos.java.accessories.vipa:2.95.0' implementation 'io.payworks:mpos.java.comlinks.tcp:2.95.0' }
If you want to use ProGuard with your application, make sure to add the necessary rules to your ProGuard configuration.
AndroidManifest.xml
file to enable a larger heap size by setting the parameter and value: 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>