# Examples

The following GitHub repositories are available to demonstrate the integration of Appfigurate Library into iOS, Android and Mobile Flutter apps and app extensions.

## Prerequisites

You must have the following installed:

* [Appfigurate Simulator](https://docs.electricbolt.co.nz/appfigurate-se-user-guide/setup-ios-simulator-app) or [Appfigurate Emulator](https://docs.electricbolt.co.nz/appfigurate-se-user-guide/setup-android-emulator-app) app installed into one or more iOS Simulators or Android Emulators (use the AppfigurateSE macOS or Windows apps for easy 1 click installation).
* The [example app's metadata records](https://docs.electricbolt.co.nz/appfigurate-user-guide/install-example-apps).

## iOS

{% hint style="warning" %}
**Note:** You *cannot* have both the Objective-C and Swift examples installed in the same Simulator, as they share the same URL Scheme and app identifiers.

To swap between language examples you must delete the existing app from the Simulator and clear Xcode's DerivedData directory.
{% endhint %}

### Swift example

{% embed url="<https://github.com/electricbolt/appfiguratesdk-swiftexample>" %}

Contains the following integrations:

* iOS native app
* iOS native app extension
* iOS native app UI automation testing support
* watchOS app extension
* watchOS intent extension

#### Installation instructions

```bash
git clone https://github.com/electricbolt/appfiguratesdk-swiftexample.git
```

In Xcode, open `SwiftExample.xcodeproj`

Ensure Appfigurate package dependency has been downloaded. (File ‣ Packages ‣ Reset Package Caches).

Select `AppfigurateExample (Swift iOS)` target, and choose the iOS Simulator that you previously installed Appfigurate Simulator into. e.g.

![](https://1008176080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1fcw3dvtSrfUh3YtO9Z%2Fuploads%2FXdW8YIHiXx06mSEzAmRn%2Fimage.png?alt=media\&token=49fb3f58-aefe-47ba-a9d7-e7f6a480753a)

Tap Run.

### Objective-C example

{% embed url="<https://github.com/electricbolt/appfiguratesdk-objcexample>" %}

Contains the following integrations:

* iOS native app
* iOS native app extension
* iOS native app UI automation testing support
* watchOS app extension
* watchOS intent extension

#### Installation instructions

```bash
git clone https://github.com/electricbolt/appfiguratesdk-objcexample.git
```

In Xcode, open `ObjCExample.xcodeproj`

Ensure Appfigurate package dependency has been downloaded. (File ‣ Packages ‣ Reset Package Caches).

Select `AppfigurateExample (ObjC iOS)` target, and choose the iOS Simulator that you previously installed Appfigurate Simulator into. e.g.

![](https://1008176080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1fcw3dvtSrfUh3YtO9Z%2Fuploads%2FgR9HxBFwmMTihdnGPTjD%2Fimage.png?alt=media\&token=c7a76407-c077-4f2e-97f7-2a3c3c2345d3)

Tap Run.

## Android

{% hint style="warning" %}
**Note:** You *cannot* have both the Java and Kotlin example apps installed on the same Emulator, as they share the same URL Scheme and app bundle identifiers.

To swap between language examples you must delete the existing app from the Emulator.
{% endhint %}

### Kotlin example

{% embed url="<https://github.com/electricbolt/appfiguratesdk-kotlinexample>" %}

Contains the following integrations:

* Android native app
* Android native app UI automation testing support (using Espresso)

#### Installation instructions

```bash
git clone https://github.com/electricbolt/appfiguratesdk-kotlinexample.git
```

In Android Studio, open the directory containing the projects `build.gradle`

Select `AppfigurateExample` Run/Debug Configuration, and choose the Android Emulator that you previously installed Appfigurate Emulator into. e.g.

![](https://1008176080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1fcw3dvtSrfUh3YtO9Z%2Fuploads%2FyUFLWIG0hjFY4MrBB8j4%2FScreen%20Shot%202022-11-27%20at%202.23.18%20PM.png?alt=media\&token=bdd4c2fc-d77c-4c47-b538-cd41d8348541)

Tap Run.

### Java example

{% embed url="<https://github.com/electricbolt/appfiguratesdk-javaexample>" %}

Contains the following integrations:

* Android native app
* Android native app UI automation testing support (using Espresso)

#### Installation instructions

```bash
git clone https://github.com/electricbolt/appfiguratesdk-javaexample.git
```

In Android Studio, open the directory containing the projects `build.gradle`

Select `AppfigurateExample` Run/Debug Configuration, and choose the Android Emulator that you previously installed Appfigurate Emulator into. e.g.

![](https://1008176080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1fcw3dvtSrfUh3YtO9Z%2Fuploads%2FyUFLWIG0hjFY4MrBB8j4%2FScreen%20Shot%202022-11-27%20at%202.23.18%20PM.png?alt=media\&token=bdd4c2fc-d77c-4c47-b538-cd41d8348541)

Tap Run.

## Flutter

{% embed url="<https://github.com/electricbolt/appfiguratesdk-flutter>" %}

Contains the following integrations:

* iOS app
* Android app

#### Installation instructions

```bash
git clone https://github.com/electricbolt/appfiguratesdk-flutter.git
```

In Android Studio, open the directory containing the projects `pubspec.yaml`

Select `main.dart` Run/Debug Configuration, and choose the iOS Simulator or Android Emulator that you previously installed Appfigurate Simulator or Appfigurate Emulator into. e.g.

![](https://1008176080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fw1fcw3dvtSrfUh3YtO9Z%2Fuploads%2FeThC97J48vdLxAEoERzP%2Fimage.png?alt=media\&token=54ecaeb5-ca38-476c-a70b-20f72765e71c)

Tap Run.
