The following sections guide you through configuring iOS in WSO2 IoT Server and enrolling an iOS device. This tutorial follows the sample scenario of the Mob X organization of which Chris (the system administrator) is configuring iOS with WSO2 IoT Server for the organization and Alex (the device owner) is registering an iOS device.
Before you begin
- WSO2 IoT Server 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 Installing the Product. Download WSO2 IoT Server and unzip it.
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.1.0.zip
Start WSO2 IoT Server 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://<IoT_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 IoT Server
For the sake of simplicity in this tutorial, we are not setting up the WSO2 IoT Server 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 IoT Server iOS agent, so those operations will not be available in this scenario.
For more information on configuring WSO2 IoT Server for iOS, including iOS client configurations, see the iOS configurations guide.
Configuring WSO2 IoT Server to install iOS applications
Configuring the IP or hostname
Installing the iOS features
Generating an MDM APNS certificate
Generating the APNS certificate
Configuring the iOS platform
Make sure to configure the
<EnabledUpdateApi>
property in the <IOTS_HOME>/conf/etc/webapp-publisher-config.xml
file back to false
if you need to restart the server again after the configuring the IP.
By enabling the update API property, the APIs and the respective web apps get updated when the server restarts. This takes some time. Therefore, if you need to restart the server many times after this configuration or when in a production environment, you need to revert back to the default setting.
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 IoT Server 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 IoT Server.cd <IoT_PRODUCT_HOME>/samples/mobile-qsg sh mobile-qsg.sh
When you add a new user to WSO2 IoT Server, the user receives an email with the username and password that needs to be used to log in to WSO2 IoT Server. In this quick start guide, we have not configured WSO2 IoT Server 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 Configuring the Email Settings.
Check out the WSO2 IoT Server dashboard by signing in to the WSO2 IoT Server console using chris as the username and chrisadmin as the password: https://<IoT_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
Enroll an iOS device
Follow the instructions given below to enroll an iOS device:
Sign in to the WSO2 IoT Server Device Management Console.
- Click Enroll New Device if you a device user. If you are administrator click Add under DEVICES.
Click iOS to enroll your device with WSO2 IoT Server.
The IoT Server registration screen appears in the Safari browser. iOS devices need the root certificate to be downloaded to trust the server certificate. If the certificate is a self-signed SSL certificate, tap Install IoT Server Certificate, else go to step 5.Tap Install as required to download the root certificate. The IoT Server registration screen appears.
Tip
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 Install IoT Server Agent.
If you are using iOS 10 or above, you will get the Cannot connect to <IP or host name> error message.
Example:
To overcome this, follow the steps given below: 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 Settings > General > About > Certificate Trust Settings .
Enable full trust for the certificate related to WSO2 IoT Server.
- Repeat step 5 again and Install the WSO2 IoT Server agent.
After the IoT Server agent is installed, click on the WSO2 IoT Server app on your device to start the registration.
Getting an Untrusted Enterprise Developer message?
When you open the WSO2 IoTS app for the first time, you may see the Untrusted Enterprise Developer message.
Tap Allow to let the WSO2 Agent access your device location.
Enter your server address, based on your environment, in the text box provided and tap Enroll Device.
- Developer Environment - Enter your entire server address as your server address.
Example:https://10.10.10.123
- Deployment Environment - Enter your domain as your server address.
- Developer Environment - Enter your entire server address as your server address.
- Enter your details:
- Domain - Enter the domain only if the server is hosted with multi-tenant support.
- Username - Enter the username that you provided when registering with WSO2 IoTS.
- Password - Enter the password that you provided when registering with WSO2 IoTS.
By default, WSO2 IoTS only supports the BYOD registration process for the iOS platform.
- Tap Login.
Read the End User License Agreement (EULA) and tap I accept the terms.
Tap Install where ever required to install the WSO2 Profile Service.
A warning message appears to indicate that by installing the profile, WSO2 IoTS has access to 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 following confirmation appears.Thereafter, your browser automatically closes and after 1 or 2 seconds, the native iOS Agent is loaded.
Try it out
You can view device details and carry out operations on your device, after successfully enrolling it with WSO2 IoTS. Let's take a look at how you can do it:
Navigate to the WSO2 IoTS Device Management page to view all the created devices.
Click the view icon on the iOS device you enrolled.
This directs you to the device details page where you can view the device information and try out operations on a device.
Unregistering and uninstalling the iOS agent
Want to unregister your device from WSO2 IoT Server and uninstall the iOS agent that's on your device? Follow the steps given below:
- Open the WSO2 iOS agent application and tap unregister.
- Next, go back, tap and hold down the icon of the iOS agent app. After a few seconds, all the apps in your iPhone will start wiggling and a tiny "X" icon will appear beside them. Note that the "X" icon will not appear beside the apps that came with the device.
- Press the "X" icon that appears beside the iOS agent app. A message-box will appear.
- Tap Delete to delete the iOS agent app.
- Navigate to Settings > General > Profiles or Profiles & Device Management.
Tap the configuration profile you installed when enrolling the device and tap Delete Profile.
Now you have successfully unregistered your device from WSO2 IoT Server, removed the profiles that were added when the iOS agent was installed, and uninstalled the WSO2 Device management application.