Hi Clover, I needed to add some permissions to an existing app/apk, so I uninstalled and reinstalled with the extra permissions ticked and an updated apk build.
Two strange things happened:
- The updated auth token did change, but literally by 1 character (from: be687e0d-7540-15a1d-f1c2-f686f571e2cf to this: be687e0d-7540-151d-f1c2-f686f571e2cf notice the 15a1d and the new one is just missing the 'a')
- Neither of these auth tokens authenticate for me anymore (I had been using the Authorization header with the api for viewing merchant/inventory and creating payments up until reinstalling a few hours ago)
I'm aware that there's some changes being made to auth mid-april, but I believe i'm following the docs correctly (as i'm able to get this new auth token consistently after reinstalling)
import com.clover.sdk.util.CloverAuth;
import com.clover.sdk.v3.base.Reference;
import com.clover.sdk.v3.inventory.Modifier;
import com.clover.sdk.v3.order.Discount;
import com.clover.sdk.v3.order.LineItem;
import com.clover.sdk.v3.order.Modification;
...
public static Observable<CloverAuth.AuthResult> authenticateClover(Context context, Account mAccount) {
return Observable.create(new Observable.OnSubscribe<CloverAuth.AuthResult>() {
@Override
public void call(Subscriber<? super CloverAuth.AuthResult> o) {
CloverAuth.AuthResult authResult = null;
try {
authResult = CloverAuth.authenticate(context, mAccount);
} catch (OperationCanceledException | IOException | AuthenticatorException e) {
e.printStackTrace();
o.onError(e);
}
if(authResult != null && authResult.errorMessage != null){
o.onError(new Throwable(authResult.errorMessage));
o.onCompleted();
} else {
o.onNext(authResult);
o.onCompleted();
}
}
});
}
Appreciate any help, Alan