Zero to BLE Part Two Core Bluetooth Post Updated for Swift at Cloud City Development Blog!

I’m happy to announce that I recently updated Part Two of my Zero-to-BLE series on Core Bluetooth Post Updated for Swift at Cloud City Development Blog! It’s been updated for Swift 2, because when I wrote it, Swift 3 hadn’t officially been released and I honestly thought it would be published well in advance of the September 7 Apple Event.

Zero to BLE on iOS – Part Two – Swift Edition

Better late than never!

Who knows? Maybe there will be a Swift 3 version in the future? For sure all my code samples will be in Swift 3…

Hope you like it!

A New Adventure

This weekend I finished and uploaded to the App Store a new version of an app I’ve been working on for the better part of this year. I uploaded version 1.0 in June and it took an extremely long time to get just one or two extra features into 1.1, and I was at long last able to get it submitted. With the average times for reviews being in the two-ish region, I’m hoping it will be up in the middle of this week.

But then there comes the next project.

This is one that I started in 2014, when I was desperate to get back into iOS development. I was stuck in a bizarre job situation in which the commute to my job was amazing – twenty minutes long through the rolling hills of Sonoma County! However, the work was clearly not in my primary domain (as far as iOS and mobile development was concerned), since it was doing Windows and a ton of SQL Server-related development. It was a pain that I could not deal with any longer.

During that rather painful time, an idea had germinated in my brain about a new app that I could develop. It is that same design that I came up with in 2014, which I have decided to reboot and develop in my off-time.

Who knows how long it will take. Perhaps I won’t be able to release it until 2017 or 2018, but it will give me the focus and drive for the Next Big Thing for myself and Interactive Logic.

In the meantime, if you need an app developed during the 9-5, please contact me or Cloud City Development, as we would be more than happy to make your app idea come alive much sooner than my humble side project!

iOS 9 Tips: Convert a Website to a PDF in Mobile Safari

I do this all the time on my Mac. I like having a PDF version of websites (as opposed to printed versions). This really comes in handy with pages like receipts. Now we can have this functionality on iOS too.

Thanks to TechCrunch for this tip!

Convert Website to PDF in Mobile Safari

Need to save a website to a PDF for some reason? You can!

It’s a bit obfuscated, but there’s a button for it in iOS 9’s build of Safari. Bring up the share sheet, then scroll the middle section over a bit until you see “Save PDF to iBooks”. Tap that, and voila! You can then share this PDF via email via the iBooks app.

How to Query Custom URL Schemes in iOS 9 (Hint: it’s different now.)

This was a new one on me and I discovered it accidentally.

In one of my apps, NineOneOne ~ One-Touch Emergency Dialer, I query for the presence of the Skype app, so that an emergency call can be placed using Skype instead of the phone app.

Why would one want to do this? Well, as it turns out, I wanted users who had an iPad or an iPod Touch to be able to use NineOneOne on those devices without the presence of the phone. The obvious candidates were Skype and Google Voice, and at the time Google did not provide a way to launch Google Voice via custom URL scheme. Therefore Skype was it.

Prior to iOS 9, this process was super easy. Just call UIApplication’s canOpenURL method:

self.skypeEnabled = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"skype://"]];

Unfortunately I noticed that this was breaking in iOS 9 and there was a little message in Xcode’s console:

This app is not allowed to query for scheme skype

…and this baffled me since I hadn’t heard of any changes to this API and it seemed like a pretty standard and common function to use.

The New Way
It turns out that, while this method still works in iOS 9, you have to take an extra step beforehand. At about the 10-minute mark in the video for Session number 703 at WWDC 2015, you will find that the presenter shows the new process going forward.

You need to open up your Info.plist file, and add a new record, LSApplicationQueriesSchemes, define it as an array, and then add the schemes that you will be querying in your app to that list:

LSApplicationQueriesSchemes-skype

Once I added that key and the “skype” URL scheme to the array in the Info.plist, the URL scheme querying immediately started to function again!

This strikes me as a way for Apple to keep track of who’s-querying-who’s-app by using the app’s metadata, and also for iOS 9 to deny any URL scheme queries that are not in the list, so we need to now be explicit up-front about which URL schemes we are interested in.

Understanding How Notifications Work on Apple Watch

I’ve had my Apple Watch for a little while now, and I have really found myself relying heavily on it as a device primarily for notifications.

The one thing that has really bothered me, however, is the somewhat random nature in which notifications are delivered to The Watch. I’m not sure I want all notifications to go to the watch, but I’d certainly like to know why some don’t end up on my watch and others do.

Finally I thought I’d take the time to find out, since I happen to be doing a lot of work lately with push notifications in iOS and I was wondering why certain notifications were delivered on my watch and others weren’t.

Turns out Apple has a little explainer on their support site that addresses that very subject:

About notifications on your Apple Watch – Apple Support

In a nutshell the rules go like this:

  • If your iPhone is unlocked, you’ll get notifications on your iPhone – not your Apple Watch.
  • If your iPhone is locked or asleep, you’ll get notifications on your Apple Watch, unless your Apple Watch is locked (i.e. you haven’t entered your passcode).

As a side note, the support article also mentions the following:

When you dismiss notifications on your Apple Watch, they’re also dismissed from your iPhone. You might get certain notifications on your watch that you need to respond to using your iPhone.

I hope this helps others who may have been a little mystified about how notifications work on Apple Watch!

How to Add an Internal Tester to TestFlight If They Already Have an iTunes Connect Account

As a consultant, I’ve had this situation come up many times, and it’s very frustrating because Apple doesn’t allow an Apple ID to belong to more than one iTunes Connect account.

The scenario is that you have a client or friend that you would like to be an internal tester in your organization’s iTunes Connect account, or, perhaps it’s the corollary situation in which you have a client who has their own iTunes Connect account and you need access to their account as a tester or admin or developer. I’ve had this situation come up both ways, and here is how I’ve dealt with it.

The main requirement is that your prospective tester has a Gmail account. I’m not sure if this trick works with other email systems but it definitely works with Gmail. So if they they do, then you should be good to go. These days most individuals and companies are using Gmail as their provider so I haven’t run into anyone that this didn’t work with yet.

On with the process!

In nutshell, to circumvent Apple’s crazy limitation, you can do the “+appname” trick on their Gmail email address. For example, if the person I want to add is “fred@myclient.com”, and the name of the app I’m working on is “Awesome App” I would send him an invitation as “fred+awesomeapp@myclient.com”. Their Gmail-based mail system will let the email through just fine.

Then, they create a new, separate Apple ID with “fred+appname@myclient.com”, and iTunes doesn’t complain. iTunes Connect emails get sent to the right place because Gmail just treats them as the same account, and then your client (or you) can have multiple iTunes Connect accounts with what amounts to the same email address.

Then when they receive the follow-up notification to join TestFlight, it arrives at the right email address, and when they tap the button in the email it opens TestFlight on their device, they sign in with their normal Apple ID (even if it’s fredjones@gmail.com), and then they’re in.

It feels a bit hackish, but it works!

I’m pretty sure I learned this technique from this blog post, which also has some other great suggestions for working with clients and getting their builds up to the App Store, which is a subject for another day…

How to Have Siri Read Your Texts Aloud

I thought it was possible to have Siri read your latest text messages, but I guess I never took the time to actually find out how to do it. It’s not exactly reassuring that this tip comes from Dummies.com, but hey… at least it’s a useful tip!

How to Have Siri Read Your Texts Aloud
How to Have Siri Read Your Texts Aloud – For Dummies

The basic workflow goes something like this:

  1. Press and hold the Home button.
  2. After the short chime, say, “[Siri] Read me my texts.”

Pretty simple, huh?

Announcement: Lightning Talk @CocoaConf San Jose 2015!

This has been something I’ve wanted to do for a long time.

I was already signed up for CocoaConf San Jose 2015, and just a couple of weeks ago they announced in a conference email that they had four slots open for Lightning Talks. I immediately jumped at the chance.

Thankfully (and amazingly)… they accepted!

I don’t want to spoil the presentation since, after all, it’s only a five-minute presentation. However, I will say that the theme is Saving lives with iBeacons and it focuses on the combination of iOS, iBeacons, and Healthcare.

The talk came out of a recent project I was working on for a client of Cloud City Development and I thought would be perfect for a talk at a conference, and the client agreed!

Therefore, I am super excited that I can do an abbreviated version of the talk at CocoaConf San Jose, and I really hope I can do in a more robust, full-featured version in the future… but first things first!

See you there!