iOS Device
The following sections guide you through configuring iOS in WSO2 IoT Server and enrolling an iOS device. WSO2 IoT Server is bundled with the WSO2 Enterprise Mobility Management (WSO2 EMM) capabilities.
This tutorial follows the sample scenario of the Mob X organization of which Chris (the system administrator) is configuring iOS with WSO2 EMM for the organization and Alex (the device owner) is registering an iOS device.
Before you begin
- WSO2 EMM supports devices on iOS 7, 8, 9, and 10.
- Install Oracle Java SE Development Kit (JDK) version 1.8.* and set the
JAVA_HOME
environment variable. For more information on setting upJAVA_HOME
on your OS, see WSO2 IoT Server documentation on Installing the Product. Download WSO2 EMM and unzip the file . WSO2 IoT Server is bundled with WSO2 EMM capabilities. Therefore, what you will be downloading is the WSO2 IoT Server pack.
The downloaded pack is referred to as
<IOTS_HOME>
throughout this document.The downloaded WSO2 IoT Server file is large. Therefore, when unzipping it the OS might extract it halfway through and stop. To avoid this, we recommend that you unzip the file via the terminal.
Example:unzip wso2iot-3.2.0.zip
Start WSO2 IoT Server's core profile, which corresponds to the WSO2 Connected Device Management Framework (WSO2 CDMF) profile.
cd <IOTS_HOME>/bin sh iot-server.sh
The default port assigned for the core is 9443.
In your browser, access the IoT Server Console by navigating to
https://<EMM_HOST>:9443/devicemgt
and log in using admin as the username and password.Fill in the following iOS form via the WSO2 site. WSO2 will send you an email with the following information.
The P2 repository with the iOS features, End User License Agreement (EULA) and the README.txt.
The iOS agent source code. You can use this if you want to customize the iOS agent application in WSO2 IoT Server.
Get your certificate signed by Apple. Register your organization with the Apple Developer Enterprise Program. Thereafter, follow the steps mentioned in MDM Vendor CSR Signing Overview.
Configuring iOS support in WSO2 EMM
For the sake of simplicity in this tutorial, we are not setting up the WSO2 EMM iOS agent on your device. Therefore, we will not walk through the iOS client configurations. Note that the 'device ringing', 'sending messages', and 'getting the device location' operations require the WSO2 EMM iOS agent, so those operations will not be available in this scenario.
For more information on configuring WSO2 EMM for iOS, including iOS client configurations, see the iOS configurations guide in the WSO2 IoT Server documentation.
If you are facing issues while configuring WSO2 EMM for iOS in your testing environment, contact us and we will help you out.
Configuring WSO2 EMM to install iOS applications
Configuring the IP or hostname
Installing the iOS features
Generating an MDM APNS certificate
Configuring the iOS platform
Creating users and a sample policy
Follow the steps given below to create two users, Alex and Chris, and a configured passcode policy. This will make it easy for you to try out the EMM quick start guide.
Tip by Chris
Have you run the sample script previously when trying out the Android quick start guide? If yes, delete the two users alex and chris, the role iotMobileUser and the sample policies that were created for Android, iOS, and Windows.
- Navigate to the
mobile-qsg
directory located in the<IOTS_HOME>/samples
directory on the terminal window. Run the
mobile-qsg.sh
script to configure the iOS server settings in WSO2 EMM.cd <IoT_PRODUCT_HOME>/samples/mobile-qsg sh mobile-qsg.sh
When you add a new user to WSO2 EMM, the user receives an email with the username and password that needs to be used to log in to WSO2 EMM. In this quick start guide, we have not configured WSO2 EMM to send emails. Therefore you will get an error in the terminal where the core profile is running. If you don't want to see this error, you need to configure the email settings. For more information, see the WSO2 IoT Server documentation on Configuring the Email Settings.
Check out the WSO2 EMM dashboard by signing in to the WSO2 EMM console using chris as the username and chrisadmin as the password: https://<EMM_HOST>:9443/devicemgt
You will then see the new iotMobileUser role, three new policies, and the two new users that were added using this script
Updating the passcode policy
As a security measure, the MobX management has asked Chris to update the passcode policy for all iOS devices so that a device user can only enter the wrong password five times. If a user fails to enter the correct password in the fifth attempt, the device will not be accessible for 15 minutes. This can be regulated in WSO2 EMM by updating the passcode policy that was already in place. Chris follows the steps given below to update the policy:
Sign out of the EMM console and log in using the following credentials:
Enter chris as the username and chrisadmin as the password.- Click LOG IN.
- In the EMM console click View under POLICIES.
Click the edit logo that is on the passcode policy for iOS devices.
Update the passcode profile that is already in place by defining the maximum fail attempts as 5, and click CONTINUE.
A profile in the context of IoT Server refers to a collection of policies.
If you want to know more about each policy setting, hover your mouse pointer over the help tip.
- The passcode policy that was created for this scenario has the following groups assigned. You can optionally update the groups.
Chris selects the set user role/s option and then selects the iotMobileuser role from the item list.
Click CONTINUE.
Optionally, you can update the name and the description of the policy.
It is mandatory that the policy is assigned to Alex's mobile device, so Chris clicks SAVE & PUBLISH to make the policy active immediately.
If you SAVE the configured profile, it will be in the inactive state and will not be applied to any devices.
If you SAVE & PUBLISH the configured profile of policies, it will be in the active state. The active policies will be enforced on new devices that enroll with IoT Server based on the policy enforcement criteria. If you want to push this policy to the existing devices and want this policy to be applied to the devices, click APPLY CHANGES TO DEVICES.
Tip by Chris
You can ensure that the policy is applied on the device by going to the enrolled device page, clicking on your device and clicking the Policy Compliance tab on the Device Management console.
Another way to ensure that the policy is enforced on the device is by checking the settings in the device. For more information, see the WSO2 IoT Server documentation on Verifying Policies Applied on an iOS Device.
Publishing applications
Chris needs to publish the WSO2Con application. Let's take a look at how you can publish an application using the WSO2 IoT Server's application publisher.
- Navigate to the App Publisher using the following URL:
https://<IoT_HOST>:9443/publisher
Enter the username as chris and password as chrisadmin.
- Click Add New Mobile Application that is under the Mobile Application drop down.
- Select iOS for the Platform.
- Select Enterprise as the Store Type
- Download the IPA file from here and select the IPA file as shown below. The IPA file size should not exceed 200MB.
Click Next, and you get the following screen.
Enter the following details of the app.
Attribute Name Value Name iOS-App Display Name iOS-App Description This is an iOS application. Recent Changes Leave blank. Version Keep the default value. Category Keep the default value. Restrict Visibility Leave blank. Banner Upload the <IOTS_HOME>/samples/mobile-qsg/apps/ios/images/banner.jpg
file.Screenshots Upload the <IOTS_HOME>/samples/mobile-qsg/apps/ios/images/screen1.jpg
file.Icon file Upload the <IOTS_HOME>/samples/mobile-qsg/apps/ios/images/icon.jpg
file.- Click Create. The created app will appear in the created list of apps.
Now toy are directed the page that has all the created applciations. - Click Submit for Review for the iOS-App application.
- Click Approve > Publish.
The iOS-App application is now available in the app store for device owners like Alex to install on their devices.
To learn more about the mobile application life cycle, see Mobile Application Lifecycle Management.
Registering the iOS device
WSO2 IoT Server supports devices on iOS 7, 8, 9, and 10.
Tip by Chris
Before you begin to enroll the device, make sure that the WSO2 IoT Server server and the device are on the same network.
Before starting to enroll the device without the iOS device agent, make sure to disable the device location on your device. Else, you run into errors.
Follow the instructions below to register an iOS device:
Sign in to the WSO2 IoT Server device management console using alex as the username and alexuser as the password.
- Click Enroll New Device.
- Click iOS to enroll your device with WSO2 IoTS.
- Enroll the device.
- Click Enroll Device.
Scan the QR code and the Safari browser will display the IoT Server iOS enrollment screen.
After scanning the QR code you will be directed to a web page. When this page appears, the web browser will typically display an "insecure connection" message, which requires your confirmation before you can continue.
- Tap Install IoT Server Certificate. The iOS devices need the root certificate to be downloaded to trust the server certificate.
The Install Profile screen appears. Tap Install.
Tip by Chris
If you are using iOS 10 with a self-signed certificate, do the following to mark it as a trusted certificate. This is required in iOS 10 because there is a change in how self-signed CA certificates are trusted by iOS devices from iOS 10 onwards.
- Open the Certificate Trust Settings found in Settings > General > About.
Enable full trust for the certificate related to WSO2 IoT Server.
- Tap the Skip Agent Installer link at the bottom of the screen.
In this tutorial, you are registering the iOS device with WSO2 IoT Server without installing the WSO2 iOS agent. Therefore, you will not be able to ring the device, get the device location or send notifications to the device using WSO2 IoT Server. If you want to try out the said operations, click Install IoT Server agent.
- On the IoT Server Registration screen, enter your details:
- Domain - You don't need to enter the domain details for this scenario.
- Username - Enter alex as the username.
- Password - Enter alexuser as the password.
By default WSO2 EMM only supports the "bring your own device" (BYOD) registration process for the iOS platform.
- Domain - You don't need to enter the domain details for this scenario.
Tap Log In.
After reading the End User License Agreement (EULA), tap I accept the terms.
Tap Install when prompted to install the carbon.super Profile Service.
A warning message appears to indicate that by installing the profile the EMM will remotely manage the iOS device. Tap Install.
Tap Trust to confirm that you are aware of the device being remotely managed by installing the profile.
After the profile is installed, click Done.
Upon the successful registration, the DEVICE ADDED confirmation appears.
Since you are not installing the WSO2 EMM iOS agent in this guide, you will get a Cannot Open Page warning message after the enrollment is complete.
Trying out iOS device operations
Alex can now navigate to the Device management page, view information specific to her device, and carry out operations on the device. She follows the steps given below:
- Access the EMM Management Console using alex as username and alexuser as the password.
- Click the icon.
- Click DEVICE MANAGEMENT.
- Click on the registered device.
Alex tries out the various operations on her device via the WSO2 EMM Management Console.
NOTE:
Because we didn't install the WSO2 EMM iOS agent while registering the device, the ring device, send notifications, and get device location operations do not function. For more information on installing the agent in the registration process, you can follow the steps in the Enrolling With the iOS Agent tutorial that is in the WSO2 IoT Server documentation.
In this tutorial, you are not installing the agent. Therefore, the device location operation fails as it needs the agent to push the location details to WSO2 EMM. To avoid error logs while testing this tutorial, comment out the following configuration that is in the
<IOTS_HOME>/Repository/deployment/server/devicetypes/ios.xml
file.<!--Operation> <Name>DEVICE_LOCATION</Name> <RecurrentTimes>1</RecurrentTimes> </Operation-->
Tip by Chris
To know if a policy is applied to your device, see the WSO2 IoT Server documentation on Verifying Policies Applied on an iOS Device.
Installing an application on the iOS device
MobX wants Chris to ensure that the employees can only download mobile applications made available via the MobX app store. For this, Chris creates and publishes the WSO2Con application to the MobX app store.
Let's take a look at how Alex installs this application on the device.
- Navigate to the App Store using the following URL:
https://<EMM_HOST>:9443/store
- Sign in using alex and alexuser as the username and password.
- Click the iOS-App mobile application, and click Install.
- Leave the text box empty and click Yes. This will install the application instantly on the device.
- A notification pops up on the device asking permission to install the application. Click Allow.
- A success message will be shown when you have successfully subscribed to the application.
- Tap install on your device to finish installing the application.
Note from Chris
Remember to change the AppDownloadURLHost
property value that is in the <IOTS_HOME>/conf/app-manager.xml
file back to HTTP if you are trying out the quick start guide for Android or testing WSO2 EMM with Android devices.
Unregistering and uninstalling the iOS agent
Want to unregister your device from WSO2 EMM and uninstall the iOS agent that's on your device? Follow the steps given below:
- Navigate to Settings > General > Profiles or Profiles & Device Management.
- Tap the WSO2 Inc profiles, such as wso2 Mobile Device Management.
Tap Delete App.
Now you have successfully unregistered your device from WSO2 EMM, removed the profiles that were added when the iOS agent was installed, and uninstalled the WSO2 Device management application.
What's next?
- Want to enroll your iOS device with the iOS agent? See the WSO2 IoT Server documentation on Enrolling With the iOS Agent
- To know more on what you can do with iOS in WSO2 IoT Server, see the WSO2 IoT Server documentation on Working with iOS Devices.