Every Android app that integrates the Layer SDK should do the following:
layerClient.registerAuthenticationListenerimmediately after creating
LayerChangeEventListenerto update UI
- Setup GCM/FCM using our push setup instructions. Work through the push setup checklist as well.
MessageParts larger than 2KB in size using
- Setup log collection using our support logging instructions
If providing a
LayerClientinstance 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.