Skip to content

Chatr is a simple, open source, Swift based iOS app designed to let you test out the capabilities of the Microsoft Intune APP SDK

License

Notifications You must be signed in to change notification settings

sleonard42/Chatr-Sample-Intune-iOS-App

 
 

Repository files navigation

Chatr - An Intune MAM iOS SDK Example (Swift)

This application is a demonstration of the Microsoft Intune SDK for iOS. A developer guide to the SDK is available here. This project implements some commonly used features so developers integrating their apps with the SDK have an example to follow.

Chatr offers a simple messaging interface allowing users to send messages, print, and save conversations to their local device. It uses the Microsoft Authentication Library to authenticate users.

Steps to run the app

In order to deploy this sample you will need an Intune subscription. Free trials are sufficient for this demo.

Step 1: Setting up Intune

You will need at least one user assigned to a user group. You can see how to create new users here and user groups here. Be sure to assign Intune licenses to your users here.

Step 2: Create and Deploy App Protection Policy (APP)

To enable MAM without device enrollment (MAM-WE), we must create a new App Protection Policy with Intune. Instructions for creating and deploying a new APP can be found here.

  1. To create an APP targeting the Chatr sample app, click on Create policy in the "App protection policies" pane.
  2. In the "Create policy" pane specify the protection policy name, description, and platform. Click on Select required apps.
  3. At the top of the pane click More apps and scroll to the bottom of the pane.
  4. Enter the Bundle ID of your app and click Add. The Chatr bundle ID can be found by selecting the project file in the Xcode project explorer, selecting the chatr target, and selecting the "General" tab. This app's bundle ID is Intune.chatr.
  5. Hit Select at the bottom of the "Apps" pane.
  6. Click the Settings button in the "Create policy" pane and set the policy settings you would like to apply to a user group for your app.
  7. Once you have selected the settings click OK at the bottom of the Settings pane and then click Create at the bottom of the "Create policy" pane. Your app should now appear in the "App protection policies" pane.

Step 3: Create and Deploy App Configuration Policy

Instructions for creating and deploying a new App Configuration Policy can be found here.

  1. To create an App Configuration Policy targeting the Chatr sample app, click on Add in the "App configuration policies" pane.
  2. In the "Add configuration policy" pane pecify the configuration policy name and description. Under "Device enrollment type" select Managed apps. Click on Select the required app.
  3. At the top of the pane click More apps and scroll to the bottom of the pane.
  4. Enter the Bundle ID of your app and click OK. The Chatr bundle ID can be found by selecting the project file in the Xcode project explorer, selecting the chatr target, and selecting the "General" tab. This app's Package ID is Intune.chatr.
  5. Click the Configuration settings button in the "Add configuration policy" pane and set the key-value pair configuration you would like to apply to a user group for your app. For intance, to change the messaging group name on the Chat Page of the Chatr sample app to "Intune", you can create a configuration where the key is "GroupName" and the value is "Intune".
  6. Once you have added the key-value pair configuration click OK at the bottom of the "Configuration" pane and then click Add at the bottom of the "Add configuration policy" pane. Your app should now appear in the "App configuration policies" pane.

Step 4: Launch the App & Sign-In

Chatr should now be properly configured with Intune. When prompted to sign in, use one of the users in the group used in Step 2 or Step 3.

Relevant Files

  • Chatr/LoginPage.swift contains logic for authenticating and enrolling the user with Intune.
  • Chatr/EnrollmentDelegate.swift contains logic which responds to an Intune enrollment or unenrollment attempt.
  • Chatr/PolicyDelegate.swift contains logic for removing data for a specific user when a selective wipe command is received from the Intune MAM service and responding to when the Intune SDK needs to restart the application.
  • Chatr/KeychainManager.swift contains logic for adding, updating, and removing user data in the keychain.
  • Chatr/ChatPage.swift
    • Registers the application to receive notifications when an IT administrator updates app configuration or protection policies.
    • Contains all of the main functionality of the app.
  • Chatr/SettingsPage.swift contains option to display the Intune Diagnostics Console, which end users can use to help IT administrators and Microsoft support diagnose issues.

About

Chatr is a simple, open source, Swift based iOS app designed to let you test out the capabilities of the Microsoft Intune APP SDK

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Objective-C 88.7%
  • Swift 8.2%
  • C 3.1%