When I run the example app(cloverinventoryexample) from clover android example which is available in github side, I am getting null value for both authToken and baseUrl? how to get their values? Can anyone help me on this ? Thanks in Advance?
When I run the example app(cloverinventoryexample) from clover android example which is available in github side, I am getting null value for both authToken and baseUrl? how to get their values? Can anyone help me on this ? Thanks in Advance?
On what device are you running the examples? The clover-android-sdk and the examples only function correctly on Clover devices. Alternatively you can try to setup an emulator that mimics a Clover device, see: https://docs.clover.com/build/android...
CloverAuth.AuthResult authResult = CloverAuth.authenticate(this, account);
if (authResult.authToken != null && authResult.baseUrl != null) {
CustomHttpClient httpClient = CustomHttpClient.getHttpClient();
String getNameUri = "/v2/merchant/name";
String url = authResult.baseUrl + getNameUri + "?access_token=" + authResult.authToken;
result = httpClient.get(url);
I use that if it's a Clover app to get any information I need with the appropriate permissions.
If it's an android app, set the app to OAUTH with the Clover website (Visit OAUTH wiki) and just trim the url
String url = api.clover.com/example/merchant?id=test
url.trim(url.indexOf(".com"))
Note, it's just a rough example.
1 Person is following this question.