Notes on Migrating from XAuthTwitterEngine to MGTwitterEngine

Unable to sleep, I instead spent the last hour porting Feathers from XAuthTwitterEngine to MGTwitterEngine (see my previous post for background).

Here are a few notes to help you for when you decide to the same:

Migrating your users

The important bit to watch out for is migrating your users from XAuthTwitterEngine to MGTwitterEngine without asking them to re-authenticate. To do this, you have to create an OAToken instance from the saved HTTP response string and save the token key and secret in the keychain. Once you've done this, you can safely ignore the legacy HTTP response string in future calls.

To translate the HTTP response bodies used by XAuthTwitterEngine to OATokens, use:

OAToken *token = [[OAToken alloc] initWithHTTPResponseBody:tokenString];

Hope this helps you while migrating.