Xamarin: Win a $10k Mobile Developer Rig from Xamarin at Build 2015

Wear the new Xamarin t-shirt from the Xamarin Build 2015 Kick Off Party to Build on April 29th for your chance to win one of three Mobile Developer Rigs worth over $10,000!   How to Enter Attend the Xamarin Build 2015 Kick Off Party on 4/28, where you’ll receive the newly designed Xamarin t-shirt. Wear […]

The post Win a $10k Mobile Developer Rig from Xamarin at Build 2015 appeared first on Xamarin Blog.

Ruben Macias: Xamarin.iOS Apps: Adding Login/Signup Capabilities

In today’s modern mobile apps it is very common for apps to require a user account in order to function.  Apps like Twitter and Instagram require a user account in order to be used.  So a very common User Experience is to show a Login Page when the app first starts up.  The user should […]

Wally McClure

Wallace B. (Wally) McClure: Data Binding with Xamarin and iOS (iPhone & iPad)

Url: http://visualstudiomagazine.com/articles/2015/04/01/a-simple-data-binding-trick.aspx

Applications and businesses live on data. Data is what makes a business a business, generates value for customers, and allows a company to generate income. Displaying data to a user is a common operation, especially in mobile. It might be immensely important for a salesperson to get the last bit of information before visiting a client or to display the location of a restaurant via a local consumer-oriented app. In this article, I’ll look at the UITableViewController class that allows you to get at and display that data in an iOS app.

Xamarin: Crédito Agrícola Banks on Xamarin Platform, Test Cloud, and Insights

Crédito Agrícola, one of the largest banks in Portugal, serves more than 1.2 million customers across 700 locations. In order to better support their increasingly mobile customer base, the bank created consumer banking apps for three mobile operating systems in the platform-specific languages. The costs of maintaining three separate teams and code bases quickly added […]

The post Crédito Agrícola Banks on Xamarin Platform, Test Cloud, and Insights appeared first on Xamarin Blog.

Nic Wise: FreeAgent releases their own iOS app – and a bit of an ode to an old app

FreeAgent have finally released their mobile app! It’s been a (very) long time coming, and giving the importance of mobile these days, I’m surprised it’s taken them this long.

To be honest, while they admit its a v1.0, it’s a good looking, and well executed app. It fits with their branding, and covers the two main areas which people use mobileAgent – my FreeAgent app – for: expenses and invoices.

From a quick spelink around the .IPA, they are using Cordova and React (and jQuery and a load of other stuff), which given their background in web, isn’t a surprise. To be honest, if I was writing (from scratch) a cross platform mobile app right right, I’d be seriously looking at React and ReactNative, especially if I had a load of web and JS people on staff. Using React and Cordova is a good stepping stone, especially (I expect) when they started this, ReactNative didn’t exist.

There are a few bits which make it obvious that it’s a web app in a container tho – I can’t edge-swipe to get back from a list to the main screen (which I use all the time), and the NavBar scrolls off the top of the screen in funny ways from time to time.

But over all, it works well, and they will improve it over time. Well done Olly, Roan, Robbie and the rest – I raise a wee dram to you 🙂


So where does this leave mobileAgent, my (aging, decreped but still quite functional) FreeAgent client? For the moment, in a simlar position to where it was before.

(I dont have any shots of what v1.0 looked like, but rest assured, it was fugly. The shot below is v1.9)

(how it looks now, in v3.5. Better, but still not good)

mobileAgent was designed at the time when data was scarce and expensive (500mb data cap? LUXUARY! 3G? Only in the big cities!), so it was (poorly) designed to work offline first and foremost. Want to do your expenses on the tube on the way home? No problem.

Note that when I say poorly, ageing and decreped, it works fine for the user. I’m talking about the constraints I have to work in – the internal design of the app, the external design (functional, but now hugely inflexible), and other aspects which make it less than fun for me to work on.

I started the app in mid 2010. I’d started using FreeAgent to manage my business in the Uk, and I loved it. I still do to be honest. But I also had an iPhone (3G!) and Novell – now Xamarin – had just released the early betas of MonoTouch – now Xamarin.iOS.

So like any nail looking for a hammer, I wrote a client for it. v1.0 was released in October 2010. That first version only did timeslips, I think, and maybe a few other bits, but since then I added expenses, bills, invoices, timeslips, mileage, contact import and editing, project editing, bank info… its a long list of duct tape and spit.

6630 downloads, nearly 5 years, and 35 releases later, and it’s at v3.5, which is likely to be the last. Why? Well, obviously FreeAgent releasing their own is a big one, but Apple recently required app updates to include a 64 bit variant, and I have to do a LOAD of work to get the app to that point, work which isn’t worth it from a time vrs money point of view.

To be honest, the whole thing hasn’t been worth it on a time vrs money point of view, but it’s been fun enough, and I’ve learned a lot, so I’m not unhappy about it.

At a guess, I’ve sunk about £30-50,000 of development time (hours * my daily rate at the time), and about £200 of actual cash (the icon). The app has made around £13,500 over that time, with a peak month (Feb 2013) of £536.

It’s paid for a few phones, and a few other bits, but mostly it’s been a learning experience and a justification, if I needed it, to HMRC/IRD that I need to spend company money on “toys”. That alone made it worth it.

6630 downloads; £13,500 revenue; 1400 monthly users (past 30 days); 30,000 user sessions (past 30 days); 3 competators announced; 1 launched (now closed) – other than the FreeAgent one


So whats next for mobileAgent? Nothing, really. Or rather, no change. It costs me nothing more to keep it in the store, and it is still useful to people as it does, and shows, some things which the FreeAgent one doesn’t – bank info, mileage, timeslips, bills, etc. I might drop the price down a bit, but there again, I don’t think thats a blocker for anyone.

I believe that FreeAgent needs to own the mobile part of their app. It’s a critical channel these days, and something they need to own and apply their own style and skill to. Their new app is a great step in that direction.

So things are looking up for FreeAgent users, I think.

Nic Wise: Authenticating with Touch ID and the iPhone pin

One thing I really love about the new iOS devices – iPhone 5S, 6, 6+ and the iPad Air 2 – is the Touch ID sensor. I’ve always had a PIN on my devices – there is too much important information on my phone to not have one – and TouchI ID takes the pain out of it1. It’s also core to the iOS experience: Apple Pay relies on it, and it’s used by iTunes and a lot of other Apple apps.

Touch ID promo shot

But one thing I want is a nice, easy way to use the Touch ID sensor in my own apps. iOS8 introduced the Local Authentication APIs. This makes it easy – trivial – to request a Touch ID authentication.

var context = new LAContext ();
context.EvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, "Do Secret Stuff", (bool success, NSError error) => {
    if (success) {
        //yay
    } else {
        switch (error.Code) {
        case LAStatus.AuthenticationFailed:
            break;
        case LAStatus.UserCancel:
            break;
        //etc
        }
    }
});

This is all good and easy, but it gives the user an option I don’t like: they can use Touch ID, or they can enter a password (or cancel). And if there is no Touch ID, it’ll just not work – it’s finger prints or nothing. Worse, there is no way to turn off the password option (or change the text).

Touch ID shot using LAContext

One thing I didn’t know about until recently is that you can get the same – or similar – prompt, but allow it to fall back to the devices PIN, without a password option. This means it works on any iOS8 device.

For most of my uses – validate that the person on the phone is the owner or someone the owner has trusted – this is the best option.

It’s just not that obvious how to do it.

The general idea for this – and I’m assuming it’s a bit of a hack workaround – is to put a new item into the Keychain, but set it’s ACLs to require the user to authenticate in order to get it back. The magic ACLs are

new SecAccessControl (SecAccessible.WhenPasscodeSetThisDeviceOnly, SecAccessControlCreateFlags.UserPresence)

In Objective-C land, this is kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly and kSecAccessControlUserPresence. For the life of me, I can’t find reference to it in Apple’s docs, but they do have a sample and also slides from a WWDC session on this. Maybe we get the docs in iOS9.

The full call to create the Keychain item is this:

var secret = NSData.FromString (UIDevice.CurrentDevice.IdentifierForVendor.ToString(), NSStringEncoding.Unicode);

var record = new SecRecord (SecKind.GenericPassword) {
    Service = NSBundle.MainBundle.BundleIdentifier,
    Account = "SecurityViewAccount",
    AccessControl = new SecAccessControl (SecAccessible.WhenPasscodeSetThisDeviceOnly, SecAccessControlCreateFlags.UserPresence),
    UseNoAuthenticationUI = true,
    ValueData = secret
};

var res = SecKeyChain.Add (record);

return (res == SecStatusCode.Success);

You can update it in a similar manner if needed, as the add will fail if the item already exists. To do the actual authentication:

var query = new SecRecord (SecKind.GenericPassword) {
    Service = NSBundle.MainBundle.BundleIdentifier,
    Account = "SecurityViewAccount",
    AccessControl = new SecAccessControl (SecAccessible.WhenPasscodeSetThisDeviceOnly, SecAccessControlCreateFlags.UserPresence),
    UseOperationPrompt = "Your message goes here", 
};
SecStatusCode status;

var res = SecKeyChain.QueryAsData (query, false, out status);
if (res != null) {
    return NSString.FromData(res, NSStringEncoding.Unicode).ToString ();
}

return null;

A non-null result means they authenticated – if you need it, the result is the secret that you stored when you created the item. This shows a subtley different UI to the user:

Touch ID UI with PIN

And better yet, on iOS8 devices without Touch ID, the user is prompted for the PIN if they press “Enter Passcode”.

There is still no customisation of the dialog. No option to ONLY use Touch ID (no PIN), which would be nice. And no fallback for devices which have no PIN set at all – you’d need to make your own PIN screen for that.

I’ve put together a very basic project which shows how it works. It’s iOS8 only, tho it works on iOS7 – it just will not let you in! When I get around to rewriting Trip Wallet, I think I’ll use this as the main authentication method.


  1. The only thing I don’t like is, sometimes, when I want to hit the media controls, the phone has already logged me in. First world problem, I know. ?