iOS Frontend

Applin's iOS frontend is in the ApplinIos library. To use it, we create a boilerplate iOS app and have it call the library on startup.

You can try the iOS frontend right now. Install the Applin Tester app from the App Store and connect to one of the demo backends. See Manual Testing.

Make a New App

  1. Download https://github.com/leonhard-llc/applin-ios-example
  2. Open the project in XCode
  3. Xcode's left-hand panel is a tab view displaying "navigators". Display the Project Navigator by clicking the left-most icon or selecting View > Navigators > Project from the menu.
  4. Change your app's Bundle Identifier
  5. Change your app's name
    • Click "Applin Example" at the top of Project Navigator. Click it again to change it into a text edit box.
    • Enter your app's new name and press ENTER.
    • "Rename project content items?" appears. Click "Rename".
    • Rename the "Applin Example" under "TARGETS"
    • Rename the "Applin Example" folder to match your app's name.
    • Select your app under "TARGETS", click the "Build Settings" tab, and change "Packaging > Info.plist File" from Applin Example/Info.plist to the new path of the file.
  6. Add your app icon to Assets > AppIcon
  7. Replace logo.png with your app's logo
    • Info.plist > Launch Screen > Image Name tells UIKit to generate a launch screen that displays logo.png in the center. It sizes the image by mapping 1 image pixel to 1 device-independent pixel. To change the logo's size on the screen, use an image editor to change its resolution.
    • To get more control over the launch screen, use a Storyboard Launch Screen.
  8. Edit Main.swift
    • Check the server URLs
      • urlForSimulatorBuilds
      • urlForDebugBuilds (for testing the app on your own devices)
      • licenseKey (used by Release builds, contains prod server URL)
    • Customize firstStartupPage
    • Update your support channels or set them to nil. These are used in StaticPages.support.
      • statusPageUrl
      • supportChatUrl
      • supportEmailAddress
      • supportSmsTel
  9. Replace terms.txt and privacy.txt

Build and Run

Build your app and run it in Simulator:

  1. Use the device selector in the XCode bar and select an item under "iOS Simulators".
    • To change the available simulated devices, click the menu item "Window > Devices and Simulators".
  2. Click the "Start the active scheme" button which looks like a triangle

screenshot

The first time XCode launches an app, it starts very slowly. When you launch an app by tapping the icon, it starts instantly.

Note: Simulator has some slightly differences from real devices. See https://developer.apple.com/documentation/xcode/devices-and-simulator/. Also, Applin has a rendering bug (applin-ios#1) that only appears in Simulator.

If you try to run your app on a physical device and it fails with a signing error, you must complete these steps:

  1. Create an Apple Developer account
  2. Pay Apple their annual fee
  3. Register your device to your Apple Developer account

Note: Release builds require a valid Applin license key. See Releasing.