Saturday, July 28, 2012

Notify your users about updates to your iOS apps

Most apps undergo updates, to fix problems, or to add new features. It's a fact of life. As is the fact that most updates go unnoticed by the end user. That's because by default Apple simply shows a badge on the icon of the "App Store" app, like so:


If you have a lot of apps installed, which are likely to produce lots of updates, I think most people would develop selective blindness towards those badge notifications, and would postpone the updates.

Another way to notify the users about an update available for a given app is to send a more vocal push notification (text alert, maybe with sound), assuming that the user agreed to receive such notifications. That may however be perceived as too pushy (or desperate), and that may be why people developed a more elegant way of notifying about updates, in a more appropriate context, which increases the chance of people acting on them. That's by simply showing the notifications when people are launching the old app, like so:


That makes sense, because now the end users are in a context where they demonstrate engagement with the app (they just started it) and the notifications have less chance to be perceived as off-putting. So this is a design idiom that makes sense to be followed.

In some instances the notifications must go further in providing more details about the upcoming update, and possibly assist the user with the upgrade. One such scenario is, for example, if the user moves an app that was initially a stand-alone app, with its own icon on the home screen, to the Newsstand. In that case the icon on the home screen would disappear and a cover corresponding to that app would appear in the Newsstand, like so:


That move has the potential to confuse people, and a notice shown by the old app before the upgrade could clarify the new location.

Another move scenario is moving an app to another developers' account. This tends to happen when a bespoke app is first developed as an experiment, with few expectations, and it's published under the developer's account. If the app is a success, the contracting clients often want to have the app moved to their own account. This is challenging because from Apple's perspective the app in the new account becomes a brand new app, completely independent from the old one. The upgrade prompt should set clear expectations about the old app being discontinued, with all future development and support slated to go in the new one.

If the app has in-app purchasing content, care must be taken to migrate purchases made in the old app to the new one. The usual purchase restoration mechanism provided by Apple is of no use here, because Apple has no notion about the 2 apps being related. So you'll need to roll out your own purchase migration mechanism. For example, when the old app is launched, you could make a snapshot of the past purchases, upload them to a server, and produce a redeemable code that could be used in the new app to restore the purchases. If you already have another way of identifying the users, perhaps through some user account/login scheme, you can use that instead to assist the migration. In iOS 5 and later this is facilitated by the newly introduced Account framework, that allows tying separate apps to the same users through their credentials on social networks like Twitter.

Another consideration would be the transfer of the name of the app. Since there can't be 2 apps with the same name, you'll need to allocate a temporary new name, then delete or rename the old app, to free up the old name, and later apply it to the new app.



Thursday, July 05, 2012

How to install MySQLdb on Mac OS X Lion

After Apple rendered all my development tools (MacBook, iPad and iPod touch) obsolete and incompatible with iOS 6, I purchased a new MacBook Pro, running Lion. So I tried installing the software I've been using on the old MacBook to the new one.

One of that software is MySQLdb. Yet I didn't remember how I installed it in the first place. So I had to start from scratch. I'm a proponent of the principle "if it ain't broken don't fix it". Since Lion comes with Python 2.7 pre-installed, I figured I'd use that.

Next missing piece was MySQL. I used a .dmg from  http://dev.mysql.com/downloads/mysql/, specifically mysql-5.1.63-osx10.6-x86_64.dmg. As the name indicates that's for a 64 bits architecture.

One important insight gathered from this site was that the architecture of Python, MySQL and the MySQLdb I've been trying to build should match. To check where I was standing I started the Python interpreter, made sure that MySQL server was running and used Activity Monitor to look at their processes like so:


So I clearly needed to build the 64 bits variant of MySQLdb. After downloading the sources from http://sourceforge.net/projects/mysql-python/ I followed the instructions from the README file with the following amendments:

1. Did a which mysql_config to see its location and updated the site.cfg to point there like so: mysql_config = /usr/local/mysql/bin/mysql_config

2. Instead python setup.py build did a ARCHFLAGS="-arch x86_64" python setup.py build.

3. Instead sudo python setup.py install I did sudo ARCHFLAGS="-arch x86_64" python setup.py install

To check the result I did import MySQLdb at the Python prompt and checked that no errors occur.

Note that following the step #2 you'll see a bunch of 'implicit conversion shortens 64-bit value into a 32-bit value' warnings. Those could probably be ignored, though there's a chance that some data loss may occur during those implicit conversions if the values on the right hand side of those assignments are large enough (probably unlikely). I tried a fix, to eliminate them, by using platform independent types like size_t instead of int and by matching the types of the variables in LHS return types of the functions in RHS of the assignments on the problematic lines. I placed a patch that attempts to fix those warnings at http://sourceforge.net/tracker/?func=detail&aid=3541063&group_id=22307&atid=374934.