The following article is ONLY  for the K2 Mobile for iOS app.

Introduction

This article describes how to make changes to the K2 Mobile for iOS app so that a modified version can be distributed through any MDM or enterprise store. Please see the Distributing K2 Mobile with Mobile Device Management (MDM) software article for an overview of deploying the mobile app with MDM software.

See the K2 Mobile Support Policy for questions related to support of MDM software.
MDM software provides security management for mobile devices. MDM software is used to manage user devices. For example, you can enforce a connection to a particular server on the specified port. You can also change the K2 Mobile app branding and distribute the app without using MDM software.

Overview

To distribute an app using an MDM platform, you need the unsigned K2 Mobile for iOS app. K2 provides this app to customers with a current maintenance agreement; contact your K2 representative for details. You can then make changes to the PLIST file, such as the default server value and other settings. Not every setting is exposed in the PLIST file, such as the user name and password, which are stored in the keychain following Apple’s security guidelines.

Steps for Modifying the K2 Mobile for iOS app

There are a number of items that you can modify within the App before redistributing within your organization. The steps for modifying the settings are as follows:

  1. Get the unsigned version of the K2 Mobile app (the .ipa file) by contacting your K2 representative.
  2. Rename the file extension from .ipa to .zip.
  3. Extract the .zip file.
  4. Navigate to the Payload folder.
  5. Right click the K2 Mobile.app file and select Show package content. This displays a list of files used inside the app.
  6. Make changes to the files as needed (described in the examples below).
  7. Browse to the original folder where the .zip file was extracted.
  8. Right click the Payload folder and select Compress Payload.
  9. Rename the file to something of your choice with a file extension of .ipa, such as K2_Mobile.ipa

After you've made changes to the app, sign it using Xcode's command line tools on a Mac. For more information about code signing, see https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html. The signing certificate is not provided by K2.

Once you’ve signed your app, deploy it using MDM software or iTunes.

Changing default server value

In the Settings.bundle\Root.plist file, modify the existing values to include a key for the default server value. The lines in bold should be added with your default server value, in the section as shown:

<dict>
                    <key>AutocapitalizationType</key>
                   <string>None</string>
                    <key>AutocorrectionType</key>
                    <string>No</string>
                    <key>IsSecure</key>
                    <false/>
                    <key>Key</key>
                    <string>server</string>
                    <key>KeyboardType</key>
                    <string>URL</string>
                    <key>Title</key>
                    <string>Server</string>
                    <key>Type</key>
                    <string>PSTextFieldSpecifier</string>
                    <key>DefaultValue</key>
                    <string>http://k2.denallix.com</string>
</dict>

You can also change the other settings from within the app (on the app settings page), such as the Refresh Timeout, Refresh Interval, and Downloading Forms.

Changing Feature Values in the Unsigned IPA

There are some new features in version 1.2.5 of the K2 Mobile app that can only be modified in the unsigned IPA file, including the application timeout setting and the Feedback URL. These settings are in the K2 Mobile.app\Info.plist file. Open the file and look for the following items:

  • K2SessionTimeOut. Numerical value (in seconds) to force the application session to time out. A value of -1 value means the session will not time out. A value of 0 value means the user is logged out as soon as they lock the device or press the Home button.
  • K2FeedbackURL. The URL used to open a web browser from the Feedback menu in the K2 Mobile app. The default is empty (which opens the K2 web site), but you may modify it to your organization's help desk or any other URL.

Branding the K2 Mobile app

There are a few things you can change to brand the K2 Mobile app to include your company's name and branded images.

  1. To update icons, replace the AppIcon**.png files with the branded versions. Apple’s developer library has the icon and images sizes detailed on their site: (https://developer.apple.com/ios/human-interface-guidelines/graphics/custom-icons/). Be sure that the file names have the same name and size in pixels as the original files being replaced.
  2. To update K2 logos used within the K2 App, replace the K2Logo**.png and K2Mobile_Logo**.png files, as well as the LaunchImage-**.png, with your branded images. Be sure that the file names have the same name and pixel size as the original files being replaced.
  3. To change the name of the app as displayed on the device, open Info.plist and change the Bundle Name and Bundle Display Name properties. This is the name that users see on their devices. Also be sure to change the Bundle Identifier property which allows your branded app to co-exist with the App Store version of the K2 Mobile app. Save and close the file then rebundle as mentioned in the steps above.