Dual-mode sample app

A sample app that shows proper dual-mode app behavior is included with the AppConnect for iOS SDK zip file in Samples > DualMode.xcodeproj.

Location of Dual mode sample app

The app illustrates how and when to use the AppConnect for iOS APIs related to dual-mode behavior. It also illustrates using AppConnect capabilities and secure data only when behaving as an AppConnect app.

The app is a simple note-taking app that allows the user to create a set of notes. The app uses the model-view-controller design pattern. The model classes are Notes and Policies. The view controllers are NotesViewController, NoteDetailViewController, SettingsViewController and AuthMessageViewController. The class DualModeAppDelegate is the main app controller.

The following table summarizes the files:

Table 8.   Dual-mode sample app files

File

Description

DualModeAppDelegate.h/m

UIApplicationDelegate for the app

Notes.h/m

Handles application logic for adding and retrieving notes.

Uses secure file I/O when required.

Policies.h/m

Implements AppConnectDelegate

Handles the dual-mode state transitions.

Keeps track of whether to use secure file
I/O and handle DLP policies.

NotesViewController.h/m

 

Provides user interface for showing the list of notes.

NotesDetailViewController.h/m

 

Provides user interface for showing the contents of an individual note.

SettingsViewController.h/m

Provides user interface for changing between AppConnect app behavior and regular app behavior.

AuthMessageViewController.h/m

Provides user interface for displaying authorization status messages.

Displaying the authorization status is only applicable when behaving as an AppConnect app.