Refresh OAuth access token with Retrofit, RxJava

A very common use case when working with OAuth is to refresh the auth token. One way could be to do it periodically. A much simpler way, although, is to try refresh the auth token when you see a 401 response for an authenticated user. This is very straightforward to…

Refresh OAuth tokens using Moya, RxSwift

A very common use case when working with OAuth is to refresh the auth token. One way could be to do it periodically. A much simpler way, although, is to try refresh the auth token when you see a 401 response for an authenticated user. This is very straightforward to…

Realm for Android

Realm is a mobile database: a replacement for SQLite & Core Data that works for both iOS and Android. It has a really concise API and works extremely fast. Let's see how we define a model in Realm: public class User extends RealmObject { @PrimaryKey private int identifier; private String firstName;…

Make Hexagonal View on iOS

In this post, we will explore a bit on how to use CALayer. With CALayers you can create some neat visual effects really easily. Let's see an example on how to mask a view to a hexagon using CALayer. We mostly see square or circular images on most apps. This…

Streaming Assets on Unity

Most assets in Unity are combined into the project when it is built. However, it is sometimes useful to place files into the normal filesystem on the target machine to make them accessible via a pathname. An example of this is the deployment of a movie file on iOS devices;…

Automatically Refresh Auth Token using RestKit

When using OAuth for authenticating your users for your app, you simply need to store the auth token (e.g. in NSUserDefaults) and you can make authenticated requests in the future. But what if the auth token expires in the future and you need to refresh it? When using RestKit…