question

saad-bin-iqbal avatar image
saad-bin-iqbal asked Lee Tickett commented

Could we know using clover android SDK if device is sandbox or production?

Is there any code or method that can tell us that clover device is sandbox or production?
As we know that we test our android clover app on sandbox using dev kit and after we upload it on production run on that deice.
We just want to know if there any code snap in android clover sdk or else that add in our clover app to get to know if it is sandbox or production device?
Clover Android SDKClover Mini
1 comment
10 |2000

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

saad-bin-iqbal avatar image saad-bin-iqbal commented ·
@Chanel , please provide details on the same.
0 Likes 0 ·

1 Answer

·
Jeffrey Blattman avatar image
Jeffrey Blattman answered Lee Tickett commented
That's not something we expose via an SDK or otherwise. Theoretically you could look at the base URL returned from CloverAuth.authenticate() but that's going to be brittle.

This thread:
https://stackoverflow.com/questions/31581830/android-how-to-check-if-developer-option-is-enabled

Talks about reading the setting to check if development mode is enabled, which would almost always be the case for sandbox devices, but not guaranteed.

You could create different flavors of your app and include a config param (XML, or a class with a static field, for example) that describes this. Then only deploy the "sandbox" flavor to sandbox, etc.
1 comment
10 |2000

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

Lee Tickett avatar image Lee Tickett commented ·

We use the technique you initially describe (checking the base URL)- Has been pretty solid so far.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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