question

gleebuyfi avatar image
gleebuyfi asked jim-patel answered

Is there a way to detect if a Clover Android App is running in sandbox?

We would like to detect if the code is running in sandbox as we need to communicate back to the server which urls to hit.

I can hard code a flag into each build if we are going to upload the build against sandbox. But I was wondering if there was a way to do it in code? That way I don't have to build a separate sandbox build instead I can just upload the same file that I use in non-sandbox.

Thanks!

Sandbox
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

jim-patel avatar image
jim-patel answered

You could use CloverAuth.authenticate to get the base URL. It should be https://apisandbox.dev.clover.com if you're running on the sandbox.

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community