question

ryanram avatar image
ryanram asked ·

CloverAccount.getAccount(context) return null

Hi,

on our integration with android clover sdk, upon fetching for CloverAccount.getAccount()
but it always returns null, do note that even tho in our source that tagetsdk is > 25, we have handle permission requests for get_accounts, and the contacts group just to be sure, and it still returns null.

edit:
upon uploading the apk on dev page I get this error, is 25 really the max target sdk allowed?



Cheers,
Ryan
Clover MiniClover Android SDKRemote Pay Android
10 |2000 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
Jacob Abrams avatar image
Jacob Abrams answered ·

After API level 25 it doesn't matter what permission you have you won't be able to access accounts of other apps, hence your error. See
https://developer.android.com/about/versions/oreo/android-8.0-changes#aaad

We are working on changes that will allow you to target API levels higher than 25 and retrieve the auth tokens you need without the Account object.

Watch this class for changes: https://github.com/clover/clover-android-sdk/blob/master/clover-android-sdk/src/main/java/com/clover/sdk/util/CloverAuth.java

Maybe next year this class will be updated but in the mean time you need set your API target to 25 or lower. Note that just because your target is 25 or lower doesn't mean you cannot invoke APIs on higher levels (of course most Clover devices are lower than 25 anyway).

Share
10 |2000 characters needed characters left characters exceeded

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

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