Exploring Apple’s Managedappconfig demo

Having created TestMDM, I’ve had a few people try to experiment with Apple’s ManagedAppConfig sample. This sample is used in their WWDC video on iOS 7’s Enterprise features and demonstrates how to used Managed App Configuration to control a URL and a UISwitch.

Unfortunately, Apple don’t provide anything more than an XCode project, so it’s hard to understand how you’re supposed to evaluate and test the code. This is what this blog post hopes to show. I’ll be using my TestMDM (http://www.testmdmapp.com) service to perform the installation and configuration, but any MDM that supports iOS 7 will be able to do the same thing.

To get started, download the XCode project from Apple. https://developer.apple.com/library/ios/samplecode/sc2279/Introduction/Intro.html

Open it in XCode and compile it. XCode may prompt you to create a provisioning profile for this app, so click Okay and let it work its magic. Once you have successfully compiled the app, you will need to Archive it.

Screen Shot 2014-03-07 at 08.25.18

Once you have successfully archived it, hit the Distribution button to start the packaging process.

 Screen Shot 2014-03-07 at 08.25.36

Sign the with the provisioning profile that was created. In this case, I am using my WildCard development profile.

 Screen Shot 2014-03-07 at 08.26.04

Choose Enterprise deployment and enter “ManagedAppConfig” as the name of the app, leaving all other fields blank. I’m saving these files to my desktop, but you can save them in a location that suits you.

Screen Shot 2014-03-07 at 08.26.26

No that we have both the IPA and Manifesto, we can open up TestMDM and get ready to deploy the app to your device for testing. I am assuming that you have registered a device for testing with TestMDM. If you haven’t please do so before continuing.

Open the commands page view and from the Queue Command dropdown, choose Install App.

Screen Shot 2014-03-07 at 08.34.47

 Screen Shot 2014-03-07 at 08.34.56

Click Browse for Manifest and navigate to where you exported the Archive from XCode. Choose the file with the plist extension.

Screen Shot 2014-03-07 at 08.35.15

Click Browse for IPA and choose the IPA file.

Screen Shot 2014-03-07 at 08.35.27

Both files should upload and you can then choose Submit.

Screen Shot 2014-03-07 at 08.35.35

At this point, you should return to your registered device. It will indicate that there is a pending app installation.


Click install and the app should be downloaded and installed on your device. Launch the app and you’ll see a simple screen showing a URL, a large empty box and a switch at the bottom. We can, using the Managed Configuration, control the value of the URL and the Cloud Sync switch


As you can see, the URL is http://foo.bar and the Cloud Document Sync is turned on. Let’s update these settings. Return to TestMDM and choose “Configure App” from the Queue Commands dropdown.

Screen Shot 2014-03-07 at 08.40.19

The bundle id comes from XCode and I have left it unchanged from the value used in the sample. This unique identifies the app.

The configuration has two settings, serverURL and disableCloudDocumentSync. This configuration is in Apple’s stand PList format. I’m using http://www.testmdmapp.com as the URL, but you can choose any value you wish.I’m also setting the disableCloudDocumentSync value to 1, which will turn off the switch. Click Queue.

In a second or two, the ManagedAppConfig app running on your test device should update.


You have just performed a managed app configuration update.

Part of Managed App Configuration is Feedback. You will notice two counts on the app, one for Success and one for Failure. In my next post, I’ll show how these values can be read from within TestMDM.

If you have any comments or questions, please leave a message here or get in touch using tomas@coldbear.co.uk.

Dealing with rejection. Apple, OpenID and my app!

I May Be Late_114So, over the past two weeks, I have submitted my new I May Be Late app to Apple twice and they have rejected my app twice. This has left me feeling rather frustrated and a little disheartened.

My app is a companion to my new web application I May Be Late which is designed to allow London Commuters to have automated messages and alerts sent should they find themselves delayed on the London Underground during their daily commute. Useful if your manager is wondering where you are first thing in the morning. It’s not too fancy, but I think it’s something that could prove very useful.

When building the web application, I took a page out of StackOverflow’s book and decided I would implement OpenID for authentication on my site. I’m a big fan of the OpenID framework so it made sense for me to implement it in my own projects. It also removes a burden on managing user’s passwords. I offer access via Google, Facebook, Yahoo and the general OpenID site. These four should, in my opinion, cover quite a large number of people making the site easily accessible.

When it came to building the iPhone app, I had to copy the same mechanism, so I implemented a simple login screen on the app and with the help of Safari, I completed a full end-to-end OpenID login mechanism for my app. It’s a simple three step process. Choose the account, login using that account, get signed into the app.




I had originally used a UIWebView to load the login page of the selected provider, but decided against that since opening Safari gives the users more confidence they are where they thing they are i.e. they know they are on Google’s signin page as they can see the address bar and the SSL padlock.

Unfortunately, Apple don’t share my sentiments of this process. They have rejected my app with the following reason:

11.13 Apps that link to external mechanisms for purchases or subscriptions to be used in the app, such as a “buy” button that goes to a web site to purchase a digital book, will be rejected

The image they attached is the Login Screen. I can, in a way, see where they are coming from. I am linking to external mechanisms e.g. Google’s OpenID page, but that is not in any way related to purchases or subscriptions. Unfortunately, this is where the waters get muddy!

On the website, I do offer users the ability to sign up for a Pro account by paying a monthly subscription using PayPal. This does, in turn, allow the user to select SMS numbers from within the iOS application for particular alerts. This ability isn’t limited to the iOS application by itself as you can configure the SMS settings using the web also. So in a round-about way, I am enabling a feature in the app by paying externally, however that feature isn’t limited to the iPhone.

I’ve raised a dispute with Apple’s App Board to see if I cannot get to the bottom of this rejection.

I’m not beginning to understand the enormous frustration faced by developers each and every day when dealing with this. It’s a little soul-destroying to wait a week and then get a simple rejection without any way to defend yourself.

UPDATE – 13:30 10th Feb 2012

I got some pointers from a tip-top iPhone developer @bendodson, who suggested that even the mere mention of an external site might be grounds for rejection. This does fit the profile. On my login page, I mention the main site in some text. It’s not really a link, but a similar thing, as pointed out to me, happened to Hulu!


This gives me an interesting choice. The ability to specify SMS as a delivery mechanism is only available when you’re have a Pro account. Since I cannot mention that in the app, I can either just turn it on silently or try to use In-App purchases to drive it. Auto-Renewing subscriptions aren’t ideal, but rather that then just drop the app completely.

UPDATE – 17:30 10th Feb 2012

Apple clarified their position. Turns out it was the simple inclusion of a web address on the login page. You simple cannot link or show a link to any external source. That’s fair enough. Here is the offending link..Issue

You can, I’m pretty sure, change an app’s behaviour externally, but you cannot tell the users about it via the app. Seems a little silly, but I reason that a blanket ban is easier to enforce rather than treat each submission on a case by case basis. If it takes them a week to get to my app, imagine how busy they are!

I’ve asked them to clarify whether or not the login mechanism is okay, since it opens Safari to login. That will hopefully be okay.

10 + D20 experience to Mr. @bendodson who called this!

What I’d like to see from the iPhone 5

This evening, UK time, Apple is expected to unveil its latest addition to the iPhone family, the iPhone 5. I’ve been an Apple iPhone user since 2008, when they released the iPhone 3G. I’ve owned the 3GS too and am currently using the iPhone 4. Whilst I’m not planning to purchase an iPhone 5, there are a few things that Apple could add that might make me change my mind.

More storage

Like most people, I probably have an average collection of digital music, made up of iTunes downloads, CD rips and “other” sources. It’s currently just over twenty gigabytes. I’m not sure that’s average. On my 32GB iPhone I have about 29GB of actual space, so my music accounts for about 70% of that space.  Combine that with my Audible audio books, photos, videos and the various apps I use and I’m in trouble. In fact, I recently found myself at a wedding having to delete photos and videos from my phone just so I could take pictures of the bride and groom. 64 GB of storage would alleviate that problem.

Better battery life

Almost everyone that owns an iPhone will complain of poor battery life. I’m no exception. I use my phone as an iPod and listen to it for several hours a day, be it music whilst programming or my audio books whilst walking. I am in the habit of charging at least once a day, sometimes twice a day. This isn’t the end of the world I suppose, but there are times where I’ve been caught short by a failing battery. If it could just go for two days without charging, it would be more than capable of handing *very* heavy usage over one day whilst still leaving 25% or 30% of the battery.

NFC (Near Field Communication)

I would very much like to see Apple adding NFC support to their devices. This would help spur on the adoption of NFC for payments and help power other stuff like London’s Oyster network. Apple would provide a top-notch UI for it and developers could do some very interesting things with it, offering alternatives to Bump for data transfer etc..

Changes to Personal Hotspot

When you turn on the Personal Hotspot feature of iOS, it turns on both Bluetooth and Wi-Fi, even if you want to only connect via Wi-Fi. When you subsequently turn off Personal Hotspot, it leaves both the Bluetooth and Wi-Fi enabled. This is just stupid. It should just return the settings to their original states i.e. if they were off, turn them back off. The extra five or six clicks required to disable Bluetooth and Wi-Fi aren’t too difficult, but goodness, they are annoying!

Location aware Wi-Fi

This is just a pipe-dream I know, but something that bugs me about Wi-Fi is that I’m in a horrible habit of leaving it turned on all the time. This isn’t good for the battery. A nice solution to this would be a feature that deactivated Wi-Fi once you left a set area. When you get home, the phone would reactivate Wi-Fi and connect to the home network, syncing to iTunes etc. Once you leave a pre-set area (like iOS 5 Reminders) it could automatically power off the Wi-Fi. There are obviously issues if you want to turn it back on, but perhaps it could turn-off after losing connection with a network, thus conserving battery life?

What’s actually expected?

There are a few things expected from the iPhone 5, the biggest being the addition of the full voice control, which would allow the dictation of emails, texts etc. I’m not too bothered by such a feature. Might be useful for those who drive a lot, but not something I see as appealing to me.

App rentals are something else I’d be pleased to see. This would allow you to rent an app from the App Store, rather than buying it. Useful if you needed the TomTom app over a weekend, but didn’t want to spend £60.

A new body shape is also expected. I’m a bit “meh“ about that. I find the iPhone 4 to be very pretty. An upgraded camera is also a given, which is nice, but not that impressive really.

So what would you like to see from the iPhone 5?

Starting game development for the iOS platform

This is the first post in my “Developing a game for the iOS and Windows Phone 7 Platforms at the same time” series. Yes, I am trying to think of a catchier name. Anyway, let me get on with it. This post will cover, as the title suggests, getting ready for developing a game on the iOS platform. At the end, you’ll have the basic Cocos2d game up and running.

Getting the tools

Before you can begin writing any code, it’s necessary to get your hands on the development SDK. Apple’s IDE is called XCode 4 and this include the iPhone SDK. There are two ways to get XCode 4.

  • If you are a member of the iOS Developer Program, you can download XCode 4 for free. Obviously, this isn’t really free since you have to pay the $99/£69 membership fee. However, if you’re serious about developing for the iOS platform, this is money well spent. You’ll need to join this to test your apps on a real device and to publish it. I would like to point out this is an annual membership, so you’ll have to cough up the money each year.
  • If you’re not willing to spend so much dough up front, that’s okay too. XCode is available to download from the Mac App Store for the small sum of $4.99/£2.99. You’ll need to join the afore mentioned iOS Developer Program in order to publish your app, so you’ll be paying a little more overall. As I mentioned, not joining the Developer program means you can’t run your app on a device, so you’ll be limited to the simulator. This will become important when it comes to testing the real world performance of your game.

I have XCode 4. Now what?

After downloading it (it’s a whopping 4GB) and installed it, you’ll need to get your hands on the Cocos2d framework. As I discussed in my initial post, this is a game development framework, that includes a powerful physics engine called Box2d. There are two downloads to make. The first is the framework itself. I’m using the 1.0.0 Beta version. You can then download XCode 4 templates. The installation of these adds some special project templates to XCode and this helps speed up development by giving you a simple, pre-canned game.

All done? Comfortable? Let’s begin!

First, fire up XCode 4. You’ll need to use Spotlight to find it, but keep in the dock after it launches. On a fresh installation, you won’t have any “Recent” projects.

XCode Welcome Screen

Select “Create a new XCode project” from the “New Project” dialog, select the cocos2d category from the iOS list on the left hand side. You should see the list of possible templates. Since I’m going to use Box2D, select that one and hit “Next”

Select project type

Next you’ll be asked to enter the name of the App and the “Company Identifier”. For this, I just use my name, so enter yours here. I’m also calling the game “Bouncy”. Don’t worry about this right now as it doesn’t have to be the actual name of your app when you come to publish it. The “Bundle Identifier” value is made up of this name plus your company name and you’ll need this later on so you can put your app onto a real device and eventually publish your app.

Enter name and bundle information

Next you need to choose where to save the XCode project files. Choose a location that’s suitable. I typically create a folder called Development under my home account and put my project there. This way there are in one place. XCode should then present you with the created project, all populated with the necessary files.

Project created and ready to go!

Use the “Run” button or CMD-R to execute the project. XCode will start compiling the files, which can take a few seconds depending on your machine. It will then launch the iPhone Simulator and you should see something like this after the splash screen disappears. As it says, tap the screen a few times using the mouse pointer.



Well done! You should now have a working iPhone game, albeit a simple, demo one. The steps in this post have essentially setup XCode and a basic game shell that we can build our actual game upon. In the next few posts, we’ll look at creating a world that has some basic physics and populating that world with some sprites and finally creating a level that is playable.