Following the tutorial here but when firebase app check is enforced all queries come back as denied
W/FirebaseProfileService: GET FAILED WITH com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions.
I have ran the app check in the main activity and it doesn't produce any errors.
fun appCheck(){
FirebaseApp.initializeApp(this)
val firebaseAppCheck = FirebaseAppCheck.getInstance()
firebaseAppCheck.installAppCheckProviderFactory(
PlayIntegrityAppCheckProviderFactory.getInstance()
)
}
I can also see the request token in the logs.
I/PlayCore: UID: [] PID: [] IntegrityService : requestIntegrityToken(IntegrityTokenRequest{nonce=*****
I/PlayCore: UID: [] PID: [] IntegrityService : Initiate binding to the service.
I/PlayCore: UID: [] PID: [] IntegrityService : ServiceConnectionImpl.onServiceConnected(ComponentInfo{com.android.vending/com.google.android.finsky.integrityservice.IntegrityService})
I/PlayCore: UID: [] PID: [] IntegrityService : linkToDeath
W/Firestore: (24.1.2) [Firestore]: ********** failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}
"***" data has been omitted for privacy reasons
Is there any way to check AppCheck or PlayIntegrity errors? Cloud monitoring only seems to monitor cloud functions. As stated before, all queries and firestore rules work properly when AppCheck is not enforced.
There also doesn't seem to be any mention of where to specify the latest version of the app besides uploading a release to play store console. Do I have to upload a release for AppCheck to allow firestore queries?
Edit: Im leaning towards this being an issue with IAM roles.