We are using a technique found elsewhere in the Community to detect if our Android app is running Sandbox or production. The technique seems to be getting false positives on some devices/accounts.
Essentially it's checkin CloverAuth.AuthResult.baseUrl for if it contains "sandbox." Here is the code:
private static class FetchBaseURL extends AsyncTask<Void, Void, CloverAuth.AuthResult> { @Override protected CloverAuth.AuthResult doInBackground(Void... params) { try { return CloverAuth.authenticate(MyApplication.getApplicationInstance().getApplicationContext(), MyApplication.getApplicationInstance().getCloverAccount()); } catch (OperationCanceledException e) { Logger.i("log_test", "Authentication cancelled"); } catch (Exception e) { Logger.i("log_test", "Error retrieving authentication"); } return null; } @Override protected void onPostExecute(CloverAuth.AuthResult result) { if (result != null) { if (result.baseUrl.contains(SANDBOX_STRING)) { Constant.WEB_URL = Constant.WEB_SANDBOX_URL; } else { Constant.WEB_URL = Constant.WEB_PRODUCTION_URL; } } } }