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

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

问题描述

我有一个应用,实现了推送通知.

I have an app, with Push notifications implemented.

我想了解在实现 GCM 时为什么需要GET_ACCOUNTS"(android.permission.GET_ACCOUNTS) 的原因?一些用户对此权限表示担忧.我在清单中使用了此权限,因为它在官方网站此处中给出.

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?

推荐答案

它使用 Google 服务的现有连接.对于 3.0 之前的设备,这要求用户在他们的设备上设置他们的 Google 帐户移动设备.设备上不需要 Google 帐户运行 Android 4.0.4 或更高版本.

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" />

阅读 Google 帐户.

to read Google account.

阅读有关此 GCM 概览

GCM 不再需要登录 Google 帐户.因此您不需要 android.permission.GET_ACCOUNTS 权限.

如果您将 GCM API 与 GoogleCloudMessaging.register),您不再需要在任何 Android 版本上配置 Google 帐户.但是,如果您使用的是已弃用的库(GCMRegistrar.html").注册),在旧版本(ICS 之前)上您仍然需要一个 Google 帐户.

更多详情请访问 https://groups.google.com/forum/#!topic/android-gcm/ecG-RfH-Aso.另一个类似的线程是 为什么 GCM 需要登录 google 帐户才能在 4.0.4 操作系统以下的设备上工作?

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天全站免登陆