Skip to content

Mockzilla Mobile UI (alpha)

Warning

Warning: This plugin is still experimental and may contain bugs! The API is also subject to change

Mockzilla provides an embedded UI for your App to control the server at runtime.

Installation

Add the gradle dependency:

implementation("com.apadmi:mockzilla-mobile-ui:0.0.5")

Add the SPM dependency in XCode:

  1. File > Swift Packages > Add Package Dependency
  2. Add https://github.com/Apadmi-Engineering/SwiftMockzillaMobileUi

Note

Note: This is not for KMP projects (for those, the gradle dependecy should be added to shared source set). This SPM dependency is for purely native iOS apps only.

Either install the package using:

flutter pub add mockzilla_ui_mobile

Or add the dependency in your pubspec.yaml file directly:

mockzilla_ui_mobile: 0.0.5

Setup

If you've not configured the Mockzilla server yet, then do that first here!

Launch The Embedded UI

You can do this from a button click or any trigger in your app code.

import com.apadmi.mockzilla.mobile.ui.launchManagementUi

/// Android Target ///
launchManagementUi(context /* Activity Context */)

/// iOS Target ///
launchManagementUi()

// Or 

// Handle the ViewController directly
createManagementUiViewController(onClose = { 
    // Dismiss the ViewController
}
import SwiftMockzillaMobileUi

launchManagementUiSwift()

// Or

// Handle the ViewController directly
createManagementUiViewControllerSwift {
  // Dismiss the ViewController
}
import 'package:mockzilla_ui_mobile/mockzilla_ui_mobile.dart';

MockzillaUiMobile.launchManagementUi();

This will launch the UI overlay allowing a user to configure the mocked endpoints.