作者:手机用户2502903937 | 来源:互联网 | 2023-05-18 11:00
我用了
//Analytics
compile 'com.google.firebase:firebase-core:9.2.1'
// Crash
compile 'com.google.firebase:firebase-crash:9.2.1'
并在我生成的清单中获得了那些人:
然后我们有以下块
我的问题:
If I use only Firebase Analytics and Crash and don’t need any messaging functional, is it Ok to remove the second block as follows:
What does it mean “Optional permission for App measurement to run” in the first block? Is it safe to remove that too?
解决方法:
Firebase Analytics使用FirebaseInstanceId.通过在Gradle的Android Studio工具窗口中运行依赖项任务可以看到这一点.输出的这一部分显示了对FirebaseInstanceId的依赖:
+--- com.google.firebase:firebase-core:9.2.1
| \--- com.google.firebase:firebase-analytics:9.2.1
| +--- com.google.android.gms:play-services-basement:9.2.1
| | \--- com.android.support:support-v4:24.1.0
| | \--- LOCAL: internal_impl-24.1.0.jar
| +--- com.google.firebase:firebase-common:9.2.1
| | +--- com.google.android.gms:play-services-basement:9.2.1
| | | \--- com.android.support:support-v4:24.1.0
| | | \--- LOCAL: internal_impl-24.1.0.jar
| | \--- com.google.android.gms:play-services-tasks:9.2.1
| | \--- com.google.android.gms:play-services-basement:9.2.1
| | \--- com.android.support:support-v4:24.1.0
| | \--- LOCAL: internal_impl-24.1.0.jar
| \--- com.google.firebase:firebase-analytics-impl:9.2.1
| +--- com.google.android.gms:play-services-basement:9.2.1
| | \--- com.android.support:support-v4:24.1.0
| | \--- LOCAL: internal_impl-24.1.0.jar
| +--- com.google.firebase:firebase-iid:9.2.1 <== FirebaseInstanceId
| | +--- com.google.android.gms:play-services-basement:9.2.1
| | | \--- com.android.support:support-v4:24.1.0
| | | \--- LOCAL: internal_impl-24.1.0.jar
| | \--- com.google.firebase:firebase-common:9.2.1
| | +--- com.google.android.gms:play-services-basement:9.2.1
| | | \--- com.android.support:support-v4:24.1.0
| | | \--- LOCAL: internal_impl-24.1.0.jar
| | \--- com.google.android.gms:play-services-tasks:9.2.1
| | \--- com.google.android.gms:play-services-basement:9.2.1
| | \--- com.android.support:support-v4:24.1.0
| | \--- LOCAL: internal_impl-24.1.0.jar
| \--- com.google.firebase:firebase-common:9.2.1
| +--- com.google.android.gms:play-services-basement:9.2.1
| | \--- com.android.support:support-v4:24.1.0
| | \--- LOCAL: internal_impl-24.1.0.jar
| \--- com.google.android.gms:play-services-tasks:9.2.1
| \--- com.google.android.gms:play-services-basement:9.2.1
| \--- com.android.support:support-v4:24.1.0
| \--- LOCAL: internal_impl-24.1.0.jar
C2D_MESSAGE权限来自与firebase-iid库关联的清单.我的猜测是,如果没有它,FirebaseAnalytics将无法获取设备的唯一ID,也无法报告数据.
关于WAKE_LOCK权限,请参阅此related answer.
我怀疑删除任何权限是安全的.您可以通过在没有它们的情况下运行并查看分析是否报告任何事件来查找.