To let your users opt-in or opt-out of using Firebase Performance Monitoring, you might want to configure your app so that you can enable and disable Performance Monitoring. You might also find this capability to be useful during app development and testing.
The following are some options to consider:
You can disable the Performance Monitoring SDK when building your app, with the option to re-enable it at runtime.
You can build your app with the Performance Monitoring SDK enabled but have the option to disable it at runtime using Firebase Remote Config.
You can completely deactivate the Performance Monitoring SDK, with no option to enable it at runtime.
Disable Performance Monitoring during your app build process
One situation where disabling Performance Monitoring during your app build process could be useful is to avoid reporting performance data from a pre-release version of your app during app development and testing.
Disable your app at runtime using Remote Config
Firebase Remote Config lets you make changes to the behavior and appearance of your app, so it provides an ideal way to let you disable Performance Monitoring in deployed instances of your app.