search

Home  >  Q&A  >  body text

在谷歌云消息推送GCM中,为什么需要在AndroidManifest添加如下权限声明,有什么原理吗?

在Google Cloud Messaging(GCM)中,需要在AndroidManifest文件中添加下面的权限声明,小米推送和个推也有类似的做法,有什么原理吗?

code from cloud-messaging/android/client#manifest

<permission android:name="<your-package-name>.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="<your-package-name>.permission.C2D_MESSAGE" />
伊谢尔伦伊谢尔伦2802 days ago732

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 17:23:59

    Won’t gcm hit a wall in China? How do you use it

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:23:59

    These permissions are custom permissions for the security of mutual access calls between applications. Application A defines permission statement permission,应用B想和应用A交互,得声明使用A声明的特定权限,即uses-permissionandroid:protectionLevel="signature" which means that while it has permission, the applications that access each other must have the same application signature to access each other.

    reply
    0
  • Cancelreply