gpt4 book ai didi

android - GCM 不适用于应用程序

转载 作者:行者123 更新时间:2023-11-29 15:20:49 24 4
gpt4 key购买 nike

我在让 GCM 为我的应用程序工作时遇到问题。我的网络应用程序正在使用 django 并使用以下应用程序:https://github.com/bogdal/django-gcm

我已经按照这些页面上的说明正确设置了 API_KEY: http://developer.android.com/google/gcm/index.html

我的 list 上有以下内容:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testapp"
android:launchMode="singleInstance"
android:versionCode="11"
android:versionName="1.2.0">

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17"/>

<permission android:name="com.testapp.permission.C2D_MESSAGE" android:protectionLevel="signature"/>

<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>

<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<!-- This app has permission to register with GCM and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="com.testapp.permission.C2D_MESSAGE"/>

<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/Theme.MyTheme">

<receiver
android:name="com.testapp.pager.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>

<category android:name="com.testapp"/>
</intent-filter>
</receiver>

<service android:name=".pager.GCMIntentService" android:enabled="true"/>
<service android:name=".services.TimeService"/>

</application>

</manifest>

有人可以给我指明正确的方向吗?我在这里尝试通过各种 SO 帖子,如下所示:

Android google cloud messaging sample not working

android GCM doesn't work

最佳答案

GCMIntentService 需要在您的默认包名称中。 Android 在其他包目录中找不到 Intent 服务。

关于android - GCM 不适用于应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18370067/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com