What is App Center?
Visual Studio App Center is a platform that helps you ship apps faster by managing the entire app lifecycle. You can automate the build, test and distribution phases of development and monitor usage and crash reports in production. Recently App Center has been enhanced to provide your app with new data and authentication features, allowing you to leverage enterprise grade, global scale backend services with ease.
Easily Add Authentication Support
App Center will help walk through the required steps when you enable Auth for your app. To start with you link to your Azure account and then create a new B2C tenant. This is a separate AD instance with a custom onmicrosoft.com domain. You create an Application on your Azure AD B2C tenant and this will manage the authorisation of your app users.
Even with limited experience with authentication systems, following the setup guide will have everything configured within minutes.
Once the app is linked the Auth page in App Center will show code snippets that you can paste into your app to enable the authentication. Authenticating users from your app is as simple as a single line of code using our SDKs available for iOS and Android. Once authenticated, the SDK will handle securely storing the token and reauthenticating the users when it expires.”
Store and Sync Data
Most apps need to store some data locally and, at some point, synchronise it with your back-end. The Data feature of App Center allows you to set this up and manage it from the Azure Portal. Underneath it is powered by Azure Cosmos DB which is a global scale cloud database engine. You can start off with very basic throughput levels but know that you can grow the capacity as your app evolves.
In order to support offline use any document you create will be cached locally if a connection is not available. By default, this is retained for one day but you can override this to cache data indefinitely if required.
Cosmos DB is a multi-model, NoSQL database, which provides you the flexibility to decide how you want to model your data. It is common to persist objects as JSON so that they can be serialized and deserialized easily. Your data can be placed in multiple partitions and App Center provides two logical partitions for your app – Public for read-only data which is accessible to all users, and Private which is read-write data accessible only to a specific user. This integrates with the Auth component already described above. Do note that if you’re using Cosmos DB with a Graph model, it will work differently to this.
The App Center API for Data is very simple as it handles serialization and deserialization for you. It supports the standard operations of Create, Read, Update and Delete. Each individual document is uniquely identified by its document ID and partition, which helps with scaling and keeping data organised. You can list all items of a particular type and use pagination to read them progressively. Currently the list operation only returns accessible documents so when offline it doesn’t have a cached copy of all documents.
A well timed notification is a proven strategy for increasing app engagement, however a poorly timed notification can also be attributed to many app uninstalls. This is why it’s important to ensure you’re sending notifications to the right people at the right time. To do this App Center allows us to send notifications to both individual users and specific segments.
However, to utilise them from your app you could potentially end up creating a lot of code and supporting services to address all the different platform implementations. App Center comes to the rescue again with a standard API which you can use to send notifications across all the major mobile platforms.
App Center allows you to send notifications both to individual users and also to specific segments called Audiences. These are based on a set of filters around properties the App Center API can identify such as app versions, countries and languages. Each custom audience can have a maximum of 1000 devices. This service allows you to quickly setup push notifications both to prompt the user and to kick off synchronisation in your app without interrupting them.
If you’re already using App Center then you’ll see the new functionality within the portal. If not, you can sign up for a free App Center account and create your first app. To use Auth and Data functionality you’ll also need an Azure account but you can start with a free trial. Currently these new features are available for iOS and Android, with SDKs available for Swift, Objective-C, Java and C# developers.