Integration checklist

Every Android app that integrates the Layer SDK should do the following:

  1. Call LayerClient.applicationCreated(this); in Application.onCreate()
  2. Call LayerClient.newInstance asynchronously in Application.onCreate()
  3. Call layerClient.registerAuthenticationListener immediately after creating layerClient
  4. Use RecyclerViewController, ListViewController, or LayerChangeEventListener to update UI
  5. Setup GCM/FCM using our push setup instructions. Work through the push setup checklist as well.
  6. Handle MessageParts larger than 2KB in size using MessagePart.isContentReady()
  7. Setup log collection using our support logging instructions
  8. Instantiate LayerClient with LayerClient.Options.HistoricSyncPolicy.FROM_LAST_MESSAGE

Note

If providing a LayerClient instance via Dagger injection, please ensure an instance exists and an authentication listener is registered before Application.onCreate() finishes. This is especially important when using GCM/FCM as push notifications can start the application from a stopped state. There needs to be an authentication listener registered at this time because it is possible that the authentication could be challenged during the subsequent sync. Not having a listener registered could cause subsequent syncs to fail and not succeed until your app can register an authentication listener.

Support