Skip to content

Commit

Permalink
tripos v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marchbold committed Sep 19, 2024
1 parent 6745ee1 commit ff53db3
Show file tree
Hide file tree
Showing 124 changed files with 5,682 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/triposmobilesdk/_includes/add-apm-appdescriptor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@


Updating your application descriptor will insert the required `extensionID`'s and generate the manifest and info additions for your application.

You update your application descriptor by running:

```
apm generate app-descriptor src/MyApp-app.xml
```

Change the path (`src/MyApp-app.xml`) to point to your application descriptor.

:::caution
This will modify your application descriptor replacing the manifest additions and info additions with the ones generated from `apm`.

You should backup your application descriptor before running this command to ensure you don't lose any information.

If you need to insert custom data into these sections see the guides for [Android](https://github.com/airsdk/apm/wiki/Usage-Generate#android) and [iOS](https://github.com/airsdk/apm/wiki/Usage-Generate#ios)
:::

48 changes: 48 additions & 0 deletions docs/triposmobilesdk/_includes/add-apm.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@



:::info
Note: All of the commands below should be run in a terminal / command prompt in the root directory of your application, generally the level above your source directory.
:::

import SetupAPM from '../../_includes/apm/setup-apm.mdx'

<SetupAPM />


### Install the extension

Install the extension by running:

```
apm install com.triposmobilesdk.TriPOSMobileSDK
```

This will download and install the extension, required assets, and all dependencies.

Once complete `apm` will have created something like the following file structure:

```
.
|____ ane
| |____ com.distriqt.TriPOS.ane # TriPOS extension
| |____ [dependencies]
|____ apm_packages # cache directory - ignore
|____ project.apm # apm project file
```

- Add the `ane` directory to your IDE. *See the tutorials located [here](/docs/tutorials/getting-started) on adding an extension to your IDE.*

- You will have an `assets` directory that contains required assets for the installed extensions. You must add the files in the `assets/android` folder to the root of your Android application package and the `assets/ios` folder to the root of your iOS application package (contains the `Frameworks` folder with required dynamic frameworks). If these folders don't exist there are no required assets for that platform.

:::info
We suggest you use the locations directly in your builds rather than copying the files elsewhere. The reason for this is if you ever go to update the extensions using `apm` that these updates will be pulled into your build automatically.
:::


- You will need to set the configuration values for usage in the extension. Call the following to step through the configuration values for this extension:

```
apm project config set com.triposmobilesdk.TriPOSMobileSDK
```

216 changes: 216 additions & 0 deletions docs/triposmobilesdk/_includes/add-manual-appdescriptor.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@

## Extension IDs

The following should be added to your `extensions` node in your application descriptor to identify all the required ANEs in your application:

```xml
<extensions>
<extensionID>com.triposmobilesdk.TriPOSMobileSDK</extensionID>
<extensionID>com.distriqt.Core</extensionID>

<extensionID>androidx.appcompat</extensionID>
<extensionID>androidx.cardview</extensionID>
<extensionID>androidx.concurrent</extensionID>
<extensionID>androidx.constraintlayout</extensionID>
<extensionID>androidx.core</extensionID>
<extensionID>androidx.recyclerview</extensionID>
<extensionID>androidx.room</extensionID>
<extensionID>androidx.work</extensionID>
<extensionID>com.distriqt.square.okhttp3</extensionID>
<extensionID>com.distriqt.square.okhttp3tls</extensionID>
<extensionID>com.distriqt.square.retrofit2</extensionID>
<extensionID>com.google.android.material</extensionID>
<extensionID>com.google.code.gson</extensionID>
<extensionID>com.google.dagger</extensionID>
<extensionID>com.google.guava</extensionID>
<extensionID>com.jetbrains.kotlin</extensionID>
<extensionID>org.apache.commons.io</extensionID>
<extensionID>org.apache.commons.lang3</extensionID>
<extensionID>org.apache.commons.validator</extensionID>
<extensionID>org.apache.logging.log4j</extensionID>
</extensions>
```



## iOS

#### Dynamic Frameworks

Add the `assets/ios/Frameworks` folder to your application package at the top / root level.
Ensure the dynamic `triPOSMobileSDK.framework` is included.


### Info Additions

The following additions are for the `InfoAdditions` node of the iPhone section in your application descriptor:

```xml
<key>MinimumOSVersion</key>
<string>12.0</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>triPOS Sample App needs Bluetooth Access to connect to the payment device.</string>
<key>UIBackgroundModes</key>
<array>
<string>external-accessory</string>
</array>
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.ingenico.easypayemv.spm-transaction</string>
<string>com.ingenico.easypayemv.spm-networkaccess</string>
<string>com.ingenico.easypayemv.spm-sppchannel</string>
<string>com.ingenico.easypayemv.spm-pppchannel</string>
<string>com.ingenico.easypayemv.spm-configuration</string>
<string>com.landicorp.USBdatapath</string>
</array>
```

These should be inserted in the following location of your application descriptor:

```xml
<iPhone>
<InfoAdditions><![CDATA[
HERE
]]></InfoAdditions>
</iPhone>
```



## Android

### Manifest Additions

The TriPOS extension requires a few additions to the manifest to be able to start certain activities. You should add the listing below to your manifest.

:::caution
Ensure you replace:
- `APPLICATION_PACKAGE` with your AIR application's Java package name, something like `air.com.distriqt.test`. Generally this is your AIR application id prefixed by `air.` unless you have specified no air flair in your build options.
:::


```xml
<manifest android:installLocation="auto" >
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="34"/>
<uses-permission android:name="android.permission.INTERNET"/>
<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" android:usesPermissionFlags="neverForLocation"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CONNECTED_DEVICE"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-feature android:name="android.hardware.usb.host"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="com.ingenico.retail.ux"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"/>
<permission android:name="APPLICATION_PACKAGE.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION" android:protectionLevel="signature"/>
<uses-permission android:name="APPLICATION_PACKAGE.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<queries>
<intent>
<action android:name="android.settings.APPLICATION_DETAILS_SETTINGS"/>
</intent>
</queries>
<application android:appComponentFactory="androidx.core.app.CoreComponentFactory" android:hardwareAccelerated="true">
<meta-data android:name="android.max_aspect" android:value="2.5"/>
<meta-data android:name="android.notch_support" android:value="true"/>
<service android:name="com.ingenico.pclservice.PclService" android:foregroundServiceType="connectedDevice"/>
<service android:name="com.ingenico.pclservice.BluetoothService" android:foregroundServiceType="connectedDevice"/>
<receiver android:name="com.vantiv.triposmobilesdk.IngenicoAxiumBootBroadcastReceiver" android:enabled="true" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<receiver android:name="com.vantiv.triposmobilesdk.IngenicoAxiumUxBroadcastReceiver" android:exported="true">
<intent-filter>
<action android:name="com.ingenico.retail.ux.ACTION_UX_REQUEST"/>
</intent-filter>
</receiver>
<service android:name="com.vantiv.triposmobilesdk.heartbeat.CheckConnectionHeartbeatService" android:foregroundServiceType="connectedDevice" android:stopWithTask="true"/>
<activity android:name="com.vantiv.triposmobilesdk.UsbAccessReceiverTranslucentActivity" android:directBootAware="true" android:excludeFromRecents="true" android:exported="false" android:label="TRIPOS Mobile SDK" android:launchMode="singleTask" android:noHistory="true" android:taskAffinity="SDK.UsbAccessReceiverTranslucentActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter"/>
</activity>
<service android:name="androidx.room.MultiInstanceInvalidationService" android:directBootAware="true" android:exported="false"/>
<provider android:name="androidx.startup.InitializationProvider" android:authorities="APPLICATION_PACKAGE.androidx-startup" android:exported="false">
<meta-data android:name="androidx.lifecycle.ProcessLifecycleInitializer" android:value="androidx.startup"/>
<meta-data android:name="androidx.work.WorkManagerInitializer" android:value="androidx.startup"/>
</provider>
<service android:name="androidx.work.impl.background.systemalarm.SystemAlarmService" android:directBootAware="false" android:enabled="@bool/enable_system_alarm_service_default" android:exported="false"/>
<service android:name="androidx.work.impl.background.systemjob.SystemJobService" android:directBootAware="false" android:enabled="@bool/enable_system_job_service_default" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE"/>
<service android:name="androidx.work.impl.foreground.SystemForegroundService" android:directBootAware="false" android:enabled="@bool/enable_system_foreground_service_default" android:exported="false"/>
<receiver android:name="androidx.work.impl.utils.ForceStopRunnable$BroadcastReceiver" android:directBootAware="false" android:enabled="true" android:exported="false"/>
<receiver android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryChargingProxy" android:directBootAware="false" android:enabled="false" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
</intent-filter>
</receiver>
<receiver android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$BatteryNotLowProxy" android:directBootAware="false" android:enabled="false" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BATTERY_OKAY"/>
<action android:name="android.intent.action.BATTERY_LOW"/>
</intent-filter>
</receiver>
<receiver android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$StorageNotLowProxy" android:directBootAware="false" android:enabled="false" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.DEVICE_STORAGE_LOW"/>
<action android:name="android.intent.action.DEVICE_STORAGE_OK"/>
</intent-filter>
</receiver>
<receiver android:name="androidx.work.impl.background.systemalarm.ConstraintProxy$NetworkStateProxy" android:directBootAware="false" android:enabled="false" android:exported="false">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<receiver android:name="androidx.work.impl.background.systemalarm.RescheduleReceiver" android:directBootAware="false" android:enabled="false" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.TIME_SET"/>
<action android:name="android.intent.action.TIMEZONE_CHANGED"/>
</intent-filter>
</receiver>
<receiver android:name="androidx.work.impl.background.systemalarm.ConstraintProxyUpdateReceiver" android:directBootAware="false" android:enabled="@bool/enable_system_alarm_service_default" android:exported="false">
<intent-filter>
<action android:name="androidx.work.impl.background.systemalarm.UpdateProxies"/>
</intent-filter>
</receiver>
<receiver android:name="androidx.work.impl.diagnostics.DiagnosticsReceiver" android:directBootAware="false" android:enabled="true" android:exported="true" android:permission="android.permission.DUMP">
<intent-filter>
<action android:name="androidx.work.diagnostics.REQUEST_DIAGNOSTICS"/>
</intent-filter>
</receiver>
<activity android:name="com.distriqt.core.auth.AuthorisationActivity" android:exported="false" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
</application>
</manifest>
```


These should be inserted in the following location of your application descriptor:

```xml
<android>
<manifestAdditions><![CDATA[
HERE
]]></manifestAdditions>
</android>
```

88 changes: 88 additions & 0 deletions docs/triposmobilesdk/_includes/add-manual.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

:::info
The following guide is used to manually install the extension, download dependencies and update the application descriptor. We highly recommend installing extensions using `apm`. Using `apm` will automate the installation and automatically handle updates and dependencies along with greatly simplifying the application descriptor generation.
:::


First step is always to add the extension to your development environment. Download the extension from the repository and then follow the tutorial located [here](/docs/tutorials/getting-started) to add the extension to your development environment.




## Dependencies

Many of our extensions use some common libraries, for example, the Android Support libraries.

We have to separate these libraries into separate extensions in order to avoid multiple versions of the libraries being included in your application and causing packaging conflicts. This means that you need to include some additional extensions in your application along with the main extension file.

You will add these extensions as you do with any other extension, and you need to ensure it is packaged with your application.


### Core

The Core extension is required by this extension. You must include this extension in your application.

The Core extension doesn't provide any functionality in itself but provides support libraries and frameworks used by our extensions.
It also includes some centralised code for some common actions that can cause issues if they are implemented in each individual extension.

You can access this extension here: [https://github.com/distriqt/ANE-Core](https://github.com/distriqt/ANE-Core).



### Android Support

The Android Support libraries encompass the Android Support, Android X and common Google libraries.

These libraries are specific to Android. There are no issues including these on all platforms, they are just **required** for Android.

This extension requires the following extensions:

- [androidx.appcompat](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.appcompat.ane)
- [androidx.cardview](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.cardview.ane)
- [androidx.concurrent](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.concurrent.ane)
- [androidx.constraintlayout](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.constraintlayout.ane)
- [androidx.core](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.core.ane)
- [androidx.recyclerview](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.recyclerview.ane)
- [androidx.room](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.room.ane)
- [androidx.work](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/androidx.work.ane)
- [com.google.android.material](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.google.android.material.ane)
- [com.google.code.gson](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.google.code.gson.ane)
- [com.google.dagger](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.google.dagger.ane)
- [com.google.guava](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.google.guava.ane)
- [com.jetbrains.kotlin](https://github.com/distriqt/ANE-AndroidSupport/raw/master/lib/com.jetbrains.kotlin.ane)

You can access these extensions here: [https://github.com/distriqt/ANE-AndroidSupport](https://github.com/distriqt/ANE-AndroidSupport).



#### Square libraries

Due to several of our extensions using the [Square open source libraries](http://square.github.io) the libraries have been separated into separate extensions allowing you to avoid conflicts and duplicate definitions. This means that you need to include the some of the square native extensions in your application along with this extension.

You will add these extensions as you do with any other extension, and you need to ensure it is packaged with your application.

This extension requires the following Square extensions:

- [`com.distriqt.square.okhttp3`](https://github.com/distriqt/ANE-SquareLibs/raw/master/lib/com.distriqt.square.okhttp3.ane)
- [`com.distriqt.square.okhttp3tls`](https://github.com/distriqt/ANE-SquareLibs/raw/master/lib/com.distriqt.square.okhttp3tls.ane)
- [`com.distriqt.square.retrofit2`](https://github.com/distriqt/ANE-SquareLibs/raw/master/lib/com.distriqt.square.retrofit2.ane)

You can access these extensions here: [https://github.com/distriqt/ANE-SquareLibs](https://github.com/distriqt/ANE-SquareLibs).



#### Apache libraries

Due to several of our extensions using the Apache open source libraries the libraries have been separated into separate extensions allowing you to avoid conflicts and duplicate definitions. This means that you need to include the some of the square native extensions in your application along with this extension.

You will add these extensions as you do with any other extension, and you need to ensure it is packaged with your application.

This extension requires the following extensions:

- [`org.apache.commons.io`](https://github.com/airnativeextensions/ANE-Apache/raw/master/lib/org.apache.commons.io.ane)
- [`org.apache.commons.lang3`](https://github.com/airnativeextensions/ANE-Apache/raw/master/lib/org.apache.commons.lang3.ane)
- [`org.apache.commons.validator`](https://github.com/airnativeextensions/ANE-Apache/raw/master/lib/org.apache.commons.validator.ane)
- [`org.apache.logging.log4j`](https://github.com/airnativeextensions/ANE-Apache/raw/master/lib/org.apache.logging.log4j.ane)

You can access these extensions here: [https://github.com/airnativeextensions/ANE-Apache](https://github.com/airnativeextensions/ANE-Apache).

Loading

0 comments on commit ff53db3

Please sign in to comment.