如何使用Genymotion重启(BOOT COMPLETED)后测试我的应用程序我使用nexus 4作为设备
<receiver android:name="com.template.SampleBootReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
Run Code Online (Sandbox Code Playgroud) 遵循文档的测试收集组 ( https://firebase.google.com/docs/firestore/security/rules-query#collection_group_queries_and_security_rules )
Firestore 安全规则
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /forums/{forumid}/posts/{post} {
allow read: if true;
}
}
}
Run Code Online (Sandbox Code Playgroud)
在 Android 应用上查询(使用 Firestore 19.0.1)
FirebaseFirestore.getInstance().collectionGroup("posts").get().addOnSuccessListener { queryDocumentSnapshots ->
Log.d(TAG, "queryDocumentSnapshots " + queryDocumentSnapshots.size())
}.addOnFailureListener {
Log.d(TAG, "exception" + it)
}
Run Code Online (Sandbox Code Playgroud)
获取异常 PERMISSION_DENIED:权限缺失或不足。