question

s1mar avatar image
s1mar asked Jeffrey Blattman commented

CloverAccount.getAccount(this); always returns null

I've tried side loading the app. I've tried pulling it via clover app updates. But, no matter what I do, I always get this as null. Note: I'm in a sandbox account
App MarketSandbox
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.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

Does your app get installed by the app updater on the device? You want to ensure it does (regardless of whether you sideload over it later). That proves the server knows about it, knows about the association to your merchant. Have you given your app permissions to query for accounts (GET_ACCOUNTS)? See example apps for details.

0 Likes 0 ·
s1mar avatar image
s1mar answered Jeffrey Blattman commented
@Bryanne Vega I had the perm in the manifest. I solved it by explicitly asking the user and getting the permission on run-time
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.

Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ commented ·

If you saying you needed to request a runtime permission on a Clover device, that should never be the case. We revert the runtime permission feature of Android to static permissions same as older versions of Android.

This is not true of course for emulators since we do not control the images.

0 Likes 0 ·
Bryanne Vega avatar image
Bryanne Vega answered
  1. Try using getContext (fragment, or YourClassName.this) or getApplicationContext() instead of "this".
  2. Make sure, as @Jeffrey Blattman mentioned, to have the permission in your manifest to GET_ACCOUNTS
  3.  <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
10 |2000

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

s1mar avatar image
s1mar answered
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