Firebase +权限 [英] Firebase + Permissions

查看:405
本文介绍了Firebase +权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚从Firebase 9.0.0更新了一个应用到Firebase 9.0.2。
我使用消息+广告。
$ b $ pre $ compile'c​​om.google.firebase:firebase-messaging:9.0.2'
编译com.google.firebase:firebase-ads:9.0.2

现在很多不必要的权限已经出现了

$ $ $ code $ android $ name $ android $ name $ android $ name =android.permission.READ_EXTERNAL_STORAGE
android:name =android.permission.WRITE_EXTERNAL_STORAGE



<我没有在任何地方添加这些权限,所以他们必须来自Firebase。
我知道我的客户不喜欢这些权限,所以我把它们删除了

 < uses-permission 
android:name =android.permission.READ_PHONE_STATE
tools:node =remove/>
< uses-permission
android:name =android.permission.READ_EXTERNAL_STORAGE
tools:node =remove/>
< uses-permission
android:name =android.permission.WRITE_EXTERNAL_STORAGE
tools:node =remove/>

我的应用程序仍然有效,消息传递和广告仍​​然有效,但我希望我的怀疑得到证实。



为什么Firebase会添加这些权限,并且像我一样删除这些权限真的可以?

解决方案

  android:name =android.permission.READ_PHONE_STATE
android:name =android.permission.READ_EXTERNAL_STORAGE
android:name =android.permission.WRITE_EXTERNAL_STORAGE

这些权限是不同的,它们不在fcm中使用。 p>

PHONE_STATE 权限了解手机的当前状态
$ b READ_EXTERNAL_STORAGE strong>和 WRITE_EXTERNAL_STORAGE 可以从应用程序中添加和删除内存中的文件,如果您没有使用这些功能,则可以将其删除。


I just updated one app from Firebase 9.0.0 to Firebase 9.0.2. I use messaging + ads.

compile 'com.google.firebase:firebase-messaging:9.0.2' 
compile "com.google.firebase:firebase-ads:9.0.2"

Now a lot of unwanted permission have cropped up

android:name="android.permission.READ_PHONE_STATE"
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"

I didn't add those permissions anywhere, so they must be from Firebase. I know my clients don't like these permissions, so I removed them with

<uses-permission
    android:name="android.permission.READ_PHONE_STATE"
    tools:node="remove" />
<uses-permission
    android:name="android.permission.READ_EXTERNAL_STORAGE"
    tools:node="remove" />
<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    tools:node="remove" />

My app still works, messaging and ads still work, still I'd like my suspicions confirmed.

Why does Firebase add those permissions and is it really ok to remove them like I did?

解决方案

android:name="android.permission.READ_PHONE_STATE"
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"

these permissions are different they are not used in fcm.

PHONE_STATE permission to know current state of phone

and READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE to add and delete file in memory from your app, if you are not using any of these functionalities you can remove it.

这篇关于Firebase +权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆