It works great. On desktop. It fails in mobile app with a message Error: disallowed_useragent. There is even known issue for Inbox Mobile.
The solution is pretty simple at the end, but not intuitive at all.
First of all, you need to enable the „Use the native browser for user authentication on iOS“ setting in your My Domain configuration. (the same probably applies to the Android setting, but I don’t have Android to test it)
Second step is more tricky and you need cooperation from your users. When they add a new account to Salesforce mobile app, they cannot click on the „Use Custom Domain“ link, but rather click on the wheel in top right corner (Select connection) and click the plus icon to add a new one.
Fill in your domain name plus my.salesforce.com, name as you wish and save. Then get back to the list of connections, choose the new one and you should be good to go.
I’m not aware of any way how to deploy this new connection to your users automatically, that manual steps has to be done.