Check out example codes for "Failed to retrieve Firebase Instance Id". It will help you in understanding the concepts better.

Code Example 1

Object reference not set to an instance of an object.'

Learn ReactJs, React Native from akashmittal.com