Easier iTunes Connect Sandbox Users with GSuite Routing

Use GSuite Routing to dynamically handle different iTunes Connect test emails.

iTunes connect testing is a pain. One of the pain points is that you have to create a bunch of iTunes Connect accounts when you want to test your purchase flows. Each of those needs a separate email address.

You used to be able to do this with the magic

  • rob+test1@hobbyistsoftware.com
  • rob+test2@hobbyistsoftware.com

And all your emails would be routed through to rob@hobbyistsoftware.com (this works for gmail, and many other email providers)

Sadly Apple disabled this capability some time in 2018 (?) – so now you need a new valid email address for every iTunes Connect sandbox user

GSuite Routing provides a neat way to restore this functionality

  1. Open your GSuite Management Console
  2. Click through to Apps > G Suite > Gmail
  3. Click on ‘Default Routing’
  4. Click ‘Add Setting’ and add something like the following

(note – the regexp is rob_.*@hobbyistsoftware.com)

This redirects all email of the format rob_something@hobbyistsoftware.com to rob@hobbyistsoftware.com

Your icon can’t look like an iMac

After about 10 updates with my new icon for Multi Monitor Wallpaper, Apple decided to reject an update because

Guideline 5.2.5 – Legal

Your app does not comply with the Guidelines for Using Apple’s Trademarks and Copyrights. Specifically, your app includes:

– Apple trademark, iMac profile/ image, imagery – or likeness – in the icon

This icon is not OK any more:

This icon is fine (for now)

Notice the narrower bezel and narrower darker stand. Apparently that makes all the difference 🙂

To be clear – the icon clearly was inspired by the iMac, though it is custom built by a third party, and not based on Apple artwork.

Anyway Multi Monitor Wallpaper has a new icon.

Active Storage: Adding a custom Analyzer for unsupported image type

When you add an attachment with Active Storage, Rails kicks off a background job to analyse the attachment. You can add your own analyzer – but the documentation is very thin on the details.

One of my apps uploads .heic image files. Unfortunately as of Rails 5; this triggers a crash in the image analyzer because imageMagick can’t yet handle this filetype.

My solution to the crash is to create a custom analyzer that handles image/heic files, and returns no metadata.

# lib/models/heic_analyzer.rb

class HeicAnalyzer < ActiveStorage::Analyzer

	def self.accept?(blob)
	  blob.content_type == "image/heic"
	end

	def metadata
	  {}
	end

end

Make sure the class is loaded

# application.rb

config.autoload_paths << "#{Rails.root}/lib/models"

then add the Heic analyzer to active storage

# config/initializers/image_analyzer.rb

Rails.application.config.active_storage.analyzers.prepend HeicAnalyzer

That’s it. Rails now handles my .heic attachment without crashing

ITunes: You’re doing it wrong. I could help – but I won’t.

I just tried to redeem a code for a Mac app through iTunes.

Apple identify that I’m using the code in the wrong place and tell me what to do (use the Mac App Store), but they could easily do better.

Better: Instead of a red error message – why not give me a link that opens the Mac App Store with the code pre-filled?

According to Stack Overflow, this link used to work:
macappstores://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/redeemLandingPage?code=NHWEL3FHRYKR

As of April 23rd 2019, that link opens the right page – but doesn’t pre-fill the code. (I have filed a bug)

Best: Why not just redeem the code for me? I’m already logged in on my mac with the right account.

Apple auto-updates Xcode, but you can’t submit with it

I woke up this morning to find that my Mac auto-updating from Xcode 10.1 to Xcode 10.2

Amongst other things, this disables Swift 3, and introduces Swift 5.

So – after updating a fork of one of the libraries I use, I updated my own code to Swift 5 and submitted to the App Store. Only to find the following:

The newly released version of XCode can’t be used to submit apps.

It turns out this is standard practice from Apple

This isn’t good enough. This kind of thing needs a checklist:

Xcode Release Checklist

  • Has it been tested
  • Can developers use it
  • Really? Can developers submit builds with it?
  • Even Mac Apps?

It’s fine to release beta versions that we can’t use.

It’s not cool if release versions don’t work.

Is It Working will stay free for some time…

I started Is It Working as a ‘side project’.

(Is It Working checks that your SSL certificates are not expiring, and that your background server processes are running as expected)

I admit – I had hopes that it would be a huge instant success with hundreds or even thousands of users – and I’d be instantly rich 🙂

via Giphy

Sadly this didn’t happen. Folks are using IsItWorking – but the numbers are not huge.

On a related note, EU tax law has an annoying ‘feature’ where if you sell a single pound worth of digital services, you need to register for sales tax and send reports every three months.

I’m allergic to that kind of admin.

So, given that I don’t want to do the admin, and that it would be a chunk of work to add a payment system to Is It Working – I’m not going to.

This is not to say that I’ll never charge – but if I do start charging, I’ll give reasonable notice, and I won’t charge current users more than $1 / month for 10 checks.

This also means that I’m not doing significant work on Is It Working.  I’ll keep it running because

  • I think it is cool
  • I use it for my own purposes

Of course – if you have a feature you’d like to see, I’m happy to add features on a sponsored basis.
I hope Is It Working will still be useful for people. If you like it – please tell your friends.
Perhaps I’ll still be rich some day 🙂

HSNotifications – Easier Better Notifications in Swift

Introducing HSNotifications. A simple, sensible, easy-to-use wrapper around NSNotificationCenter

Let’s jump straight in. I mostly use notifications to keep my UI up to date. That means ViewControllers end up with a bunch of observers that need to be activated and de-activated with the ViewController lifecycle

Easy ViewController Integration

class ViewController: NSViewController, HSHasObservers {
    
    override func viewDidLoad() {
        super.viewDidLoad()

        //Create and add
        HSObserver.init(forName: Foo.didAThing,
                            using: { (notif) in
                                //Do Something
        }).add(to: self)
        
        //Monitor multiple notifications
        HSObserver.init(forNames: [Bar.oneThing,Bar.anotherThing] ,
                            activate:true,
                            using: { (notif) in
                                //Do Something Else
        }).add(to: self)
    }
    
    override func viewWillAppear() {
        super.viewWillAppear()
        
        activateObservers()
    }
    
    override func viewDidDisappear() {
        super.viewDidDisappear()
        
        deactivateObservers()
    }
}

Taking this step by step:

ViewController uses the protocol HSHasObservers

This allows us to add observers to the ViewController (they are stored in the observers array)

Next we create an HSObserver object. The block will be triggered by any Foo.didAThing notification.

We take sensible defaults

  • Assume you want to use NSNotificationCenter.default
  • Assume you want your block to fire on the main queue
  • Assume you don’t care what object broadcasts the notification.

(Of course – you can override any of these if you want to.)

The observer is added to the ViewController with .add(to:self)

Next we add an HSObserver to observe multiple Notifications

Finally, the observers are activated and deactivated in viewWillAppear and viewDidDisappear

When the ViewController is released, they are cleaned up automatically.

Standalone Observers

    var waveObserver:HSObserver
    init() {
        waveObserver = HSObserver.init(forName: Watcher.wave,
                                           using: { (notif) in
            //Do Something
        })
        
        //activate
        waveObserver.activate()
        
        //deactivate
        waveObserver.deactivate()
    }

HSObserver objects can be stored as a standard variable.

This allows them to be activated and deactivated.

They clean up properly when they are released with the owning object.

There are of course lots of options available here.

    /// Create observer
    ///
    /// - parameter name:  notification name
    /// - parameter obj:   object to observe (default nil)
    /// - parameter queue: queue to run the block on (default main)
    /// - parameter center: notification center (default NotificationCenter.default)
    /// - parameter block: block to run (beware of retain cycles!)
    ///
    /// - returns: unactivated manager. Call activate() to start
    convenience init(forName name: NSNotification.Name, 
                     object obj: Any? = nil,
                     queue: OperationQueue? = .main,
                     center newCenter: NotificationCenter = NotificationCenter.default,
                     activate: Bool = false,
                     using block: @escaping (Notification) -> Swift.Void)

Get HSNotification at GitHub

Secret Mac App Store Rule – Minimum Trial Length

I recently started experimenting with free trials in the Mac App Store.

Photo by AbsolutVision on Unsplash

The first App I changed is Icon Tool. This is an incredibly simple app that lets developers generate icon assets for iOS or Mac OS apps.

Because the app is so simple, I only wanted to give a short trial. Just long enough for you to see how it works. The relevant app store rule is:

3.1.1  In-App Purchase:

Non-subscription apps may offer a free time-based trial period before presenting a full unlock option by setting up a Non-Consumable IAP item at Price Tier 0 that follows the naming convention: “XX-day Trial.”

So, I created a 1-day Trial IAP item and submitted my app. It was rejected with the reason:

‘We found that your app includes an in-app purchase free trial period, but the free trial period is shorter than the minimum 3 days.’

I have asked for clarification on where/if the 3 day rule is documented and got the response:

‘We understand that you may not agree with the feedback we have provided. However, to ensure App Store customers a safe and enjoyable experience, all apps must comply with the App Store Review Guidelines.’

I have no argument with this statement. My issue is that the 3 day rule doesn’t exist in the published guidelines

I submitted an appeal essentially asking for clarification on whether this was really a rule, and if so – where/whether it was published.

The appeal responded with a section of text which did indeed describe the 3-day minimum. That text isn’t in the published guidelines though (and frustratingly, I didn’t save it).

So – It’s a rule. A secret rule, but one I have to follow.

Google Play – No need to go Nuclear!

One of the apps I maintain recently got this message from Google Play

After review, <your app> has been removed from Google Play due to a policy violation. This app won’t be available to users until you submit a compliant update.

Issue: Violation of Usage of Android Advertising ID policy and section 4.8 of the Developer Distribution Agreement

The app was completely removed from the store.

It’s a fair cop. We use Google’s firebase library, and we hadn’t realised that this library uses the advertising ID.

The fix was simple. We had to update the privacy policy, make sure that the store listing points to the privacy policy, and add a link in the settings of the app which opens the privacy policy. In other words – as far as users are concerned, nothing much changed.

I have no objection to the rule – but removing the app from the store is massive overkill.

Apple deal with this kind of issue with a message to the developer that then need to submit an update within (say) 7 days. Surely Google could adopt a similar approach for minor violations.

Multi Monitor Wallpaper 2

Dynamic Wallpapers – Multiple Monitors

Multi Monitor Wallpaper just got its biggest update ever.

App Store Link

It isn’t just the best way to do wallpapers with multiple monitors – it’s great even if you only have one monitor!

  • Dynamic Wallpaper Support
  • AutoChanger (change wallpaper daily, hourly, on wake, etc)
  • Unsplash Browser
  • Multiple Space support (change wallpapers across multiple spaces)

Try Multi Monitor Wallpaper for Free

And I’m trying something new. Multi Monitor Wallpaper is still a paid app ($4.99) – but you can now download it and try it for 3 days completely free.

App Store Link