Requisite iOS 8 wishlist

This is just a list of the personal pain points that I have at least a tiny hope of seeing fixed. I’ll assume that Apple aren’t going to get better (or more open) at cloud services. So asking for an iMessage that works, or that will also work on Android (I avoid things that lock me into a single platform nowadays) is a non-starter. Likewise, there are things I’d like that are never going to happen (choosing the default camera app, choosing the default web browser, relaxed app review). From most-likely (?) to least-likely:

  • I’d like to see which apps are using all my battery. Mavericks grew this last year. There’s a “that’s too much information” argument, but the phone will already tell break down cell data usage by app – to me, knowing what’s using battery seems more useful than that.
  • Stop home screen icons auto-arranging, so you can leave gaps between icons.
  • Make the notification settings screen not awful. Just sorting the list of apps would help. But also removing the pointless distinction between the two lists, and letting me see which apps can (eg) make noise without having to tap on every single one.
  • I want to be able to share links and images to WhatsApp (this is an end-run around iMessage). I want “links” and “images” to be treated as special objects, and let third party apps register to handle them. (On Android this has led to abuse but this is mostly because of the naïve implementation there.) Sharing links to Pocket from any app without needing special integration, sharing images to Instagram direct from the camera app, whatever. This doesn’t even need full-on XPC, just launching the other app and sending a file will do it. 90% of the infrastructure is already there.
  • As a developer, I’d like to see code signing requirements relaxed a little. I’d like to see closed beta testing for apps that doesn’t require collecting UUIDs and managing devices and having to turn people away because you might hit your 100 device limit*. I spend days fighting this rubbish. And it stops no piracy because people who want to do that are just jailbreaking their devices.
  • I’d like to know if I just pressed “snooze” or “stop” on the alarm, so I know if it will go off again 5 minutes after I get in the shower.

* The 100 device limit is clearly not taken seriously in Apple because you’re supposed to get an enterprise cert. The $100/year developer level is for toy developers. If you’re doing anything serious at all, you’re doing beta testing with an enterprise certificate. That’s why Apple don’t care about solving that problem – no-one they care about has that problem.

Custom UINavigationController back buttons under iOS7

When you first create / get a reference to the navigation controller, set a global custom back image (replaces the chevron) with:

[self.navigationController.navigationBar setBackIndicatorImage:
    [UIImage imageNamed:@"CustomerBackImage"]];
[self.navigationController.navigationBar setBackIndicatorTransitionMaskImage:
    [UIImage imageNamed:@"CustomerBackImage"]];

The title of the back button is owned by the view that it points to, not the current view. You can make it blank by calling

self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc]
    initWithTitle:@""
    style:UIBarButtonItemStylePlain
    target:nil
    action:nil];

in the view that the back button points to. So call it in prepareForSegue or before pushViewController:animated: or something. Setting a view controller’s title programmatically seems to reset it, so set it after setting the title.

You’ll see lots of advice to set self.navigationItem.leftBarButtonItems (which breaks swipe-to-go-back) then mess with interactivePopGestureRecognizer to fix swipe-to-go-back (which has some exciting doesn’t quite work right edge case problems). Don’t do that. Do this.

renewing ACAccount credentials on iOS

An iOS 5/6 device can have system-level Twitter/Facebook accounts that become disassociated from the underlying service accounts. This means that the ACAccountStore framework will return you ACAccount objects that can be used to sign requests and get access tokens, but NONE OF THE REQUESTS WILL WORK and you’ll get MYSTERIOUS OAUTH ERRORS and LOTS OF SUPPORT MAIL and be GRUMPY because it WORKS FOR YOU JUST FINE.

I’m not certain how to fake this state. Changing your Facebook password and choosing to log out other devices is pretty reliable, albeit really annoying if you actually use Facebook for anything. Likewise, changing your Twitter password might work. I think restoring the phone from backup will also cause this problem, especially if it’s a iTunes-based non-encrypted backup, because the passwords aren’t saved, but the phone won’t prompt you at any point to enter them again.

When this happens to Twitter account objects, I see server responses to otherwise perfectly reasonably signed requests with the error Bad Authentication data and the error code 215. I used to get This method requires authentication when calling the old 1.0 API, because the 1.0 API interprets a bad signature as no signature (REALLY ANNOYING), but the 1.1 API is a lot stricter.

When this happens with Facebook, I see Error validating access token: The session has been invalidated because the user has changed the password and sometimes Error validating access token: Session does not match current stored session. This may be because the user changed the password since the time the session was created or Facebook has changed the session for security reasons.

The solution to this is the method on ACAccountStore:

- (void)renewCredentialsForAccount:(ACAccount*)account
                        completion:(ACAccountStoreCredentialRenewalHandler)completionHandler;

From the docs:

For Twitter and Sina Weibo accounts, this method will prompt the user to go to Settings to re-enter their password.

For Facebook accounts, if the access token has become invalid due to a regular expiration, this method will obtain a new one.

If the user has deauthorized your app, this renewal request will return ACAccountCredentialRenewResultRejected.

Calling this method on the ACAccount object you’re trying to deal with will make-or-break it. I find that the token either works afterwards, or doesn’t, but now it doesn’t work because the iOS device knows that it doesn’t have a valid token. You may still have to punt the user into the Settings app to fix it. For instance, in the case of Twitter I find that calling renewCredentialsForAccount will pop up a system dialog about the problem.

Facebook is more subtle – the ACAccount object can still be used to get an access token, but that token will fail on the server with The session has been invalidated because the user has changed the password still. However, punting them manually into Settings.app at this point will ask them for a Facebook password and things will work afterwards.

Alas, it’s asynchronous. You can work around that. Call it on the ACAccount instance before you try to do something serious with it, or do work in the callback.

I hope this helps -someone-, because it sure would have helped me 6 months ago.

iOS data security and @parislemon

Android and iOS are operating systems that run on computers. Granted, these computers are smaller than the ones you grew up with, but they’re still computers. And guess what? In many ways, they work like computers have in past — including the ability of accessing your other files. It’s a feature, not a bug.

MG Siegler – Prompts

I agree – phones are computers now. But we’re still right to be annoyed over this, in the same way we were right to be annoyed over PathGate. Apps on my phone have the ability to go behind my back and take my (and other people’s) personal data. Of course they can. It’s a computer. They can do all sorts of things, and there are perfectly good and safe reasons to do all of them. This power can be used for evil! And it’s not possible to tell in advance if a given application is going to do something evil.

But we’re still right to be annoyed, because preventing this sort of thing was pretty much the entire premise of the app store review process. (That, and stopping iPhones bringing down the entire West Cost phone network, of course.) Apple promised to protect us from evil applications, and used this as justification for all sorts of stupid rejections that in no way made my iPhone experience safer.

I’m prepared to accept the trade off of a review process that sometimes stops good things if it’ll also stop bad things. But it’s not stopping the bad things. And it’s not possible to stop the bad things. It probably stops a lot of them. But that’s not the trade-off I was promised.

Notification slide-downs

Android

The pull-down is a progressive reveal: when it’s half-way out, you see the top half, which is probably where the stuff you care about is.

iOS 5

The pull-down slides the view into place: when it’s half-way out, you see the bottom half, which will be blank if you only have a couple of notifications. Also, there’s no indication that you have any notifications unless you pull the slide out.

Pretty trivial, to be honest. And both entirely fixable before the actual release of the thing.

iPad interface design

[..] there is a reason I didn’t go into Weather apps on the iPad, it is just a much more difficult device to layout weather information on.

Ben Brooks

Not just weather apps information. I have no design skills at all, but I was able to write a functional iPhone app and put it on the app store by just putting the obvious information in the obvious place. There’s little enough room that a lack of imagination doesn’t matter so much.

All my efforts to port it to the iPad have been thwarted by the fact that I suddenly have a MILLION PIXELS TO FILL. The desktop version gets round this problem by just using a smaller window, but on the iPad you have to fill the screen, but not crowd the screen.

OS release schedules

Google delays Honeycomb tablet OS; what if that was Apple

Can you imagine if it were Apple delaying a software release. What would the press say if Apple admitted it took shortcuts with its OS to keep up with Google and now they couldn’t release it? The press would have a field day with that story.

You’re right. Apple would never release, say, an OS with multitasking in it for only their new phone platform, and not make it available for their tablets for months. They’d get ROASTED.

OH WAIT.

What Are Tablets For? · The trade-off is obvious. You win because you can show a bigger picture, which is important, and you lose because it just won’t fit in many pockets, which is important. It’ll go in most purses, though.

ongoing by Tim Bray · Galaxy Tab

Tim thinks tablets are big phones, then. And maybe the tab is. But my iPad is a computer, not a phone.

(via Instapaper)