使用GCM时的GET_ACCOUNTS权限 - 为什么需要? [英] GET_ACCOUNTS permission while using GCM - Why is this needed?

查看:196
本文介绍了使用GCM时的GET_ACCOUNTS权限 - 为什么需要?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想了解为什么我们需要GET_ACCOUNTS(android.permission.GET_ACCOUNTS),同时实现GCM?一些用户正在对此权限提出担忧。我已在官方网站此处中提供了该清单中的这一许可。



这项权限有多安全?如果我从清单中删除它,推送通知是否可以正常工作?

解决方案


Google服务的现有连接。对于3.0美元以前的b $ b设备,这需要用户在其
移动设备上设置Google帐户。对于运行Android 4.0.4或更高版本的设备
,Google帐户不是必需的。


所以这是权限要求

 <使用权限android:name =android.permission.GET_ACCOUNTS/> 

来阅读Google帐户。

详细了解此 GCM概述






Google帐号登录不再所以你不需要 android.permission.GET_ACCOUNTS 权限。



如果您将GCM API与 GoogleCloudMessaging一起使用.register ),您不再需要在任何Android版本上配置Google帐户。但是,如果您使用的是已弃用的库( GCMRegistrar.register ),您仍然需要旧版Google帐户(在ICS之前)。 更多详情请参阅 https://groups.google.com/forum。 /#!话题/ Android的GCM / ECG-RFH - 阿苏。另一个similer线程是为什么Google帐户登录需要GCM为4.0.4 OS以下的设备工作?


I have an app, with Push notifications implemented.

I want to understand the reason why we need "GET_ACCOUNTS"(android.permission.GET_ACCOUNTS), while implementing GCM? Some users are raising concerns with this permission. I have used this permission in the manifest as it was given in the official site here.

How safe is this permission? and if I remove this, from my manifest, will the push notifications work?

解决方案

It uses an existing connection for Google services. For pre-3.0 devices, this requires users to set up their Google account on their mobile devices. A Google account is not a requirement on devices running Android 4.0.4 or higher.

SO this is the reason for requirement of the permission

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

to read Google account.

Read more about this GCM Overview


Google account login is no longer needed for GCM to work. So you no need the android.permission.GET_ACCOUNTS permission.

If you are using GCM API with GoogleCloudMessaging.register), you no longer need to configure Google account on any Android version. But if you are using the deprecated library (GCMRegistrar.register), you still need a Google Account on older versions (before ICS).

More details at https://groups.google.com/forum/#!topic/android-gcm/ecG-RfH-Aso. Another similer thread is Why google Account login is required for GCM to work for devices below 4.0.4 OS?

这篇关于使用GCM时的GET_ACCOUNTS权限 - 为什么需要?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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