Since ACRA.init can only be called once and ACRA.getConfig() and ACRA.getConfig().setFormUri(uri) are both deprecated.Is there any correct way to change formUri programatically, once ACRA has been already initialized?
In our development app we are testing against several environments and we have different formUris to store ACRA errors, so each time we change to a new environment we must reconfigure ACRA to send all the errors to that formUri.
Right now we are using ACRA.getConfig().setFormUri(uri).
But we are afraid that this won't be possible in the nearby future, so is there any alternative?
There are no plans to allow ACRA to be initialised multiple times. It would introduced unnecessary complexity into a component that you need to be as rock solid as possible.
But you still have the capability of setting the formUri programmatically. You can just set it only once.
You clearly have some event at runtime that knows/determines which environment you are in. So you could set a SharedPreference at that point outlining the target formUri. Restart the app and have the formUri come from the SharedPreference.
NB this is an extremely unusual use case. Why do you have a separate formUri for the different environments for the one app? Why not have a single error repo and filter reports based upon some attribute in the report, such as environment?
IMHO having separate error reporting servers for even dev and release versions of an app is a nett negative as it means there is one more thing that you have changed between dev and release that you didn't need to. Less moving parts, less complexity == greater robustness.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With