Android 提醒推送
我正在android上开发一个应用程序,你可以注册接收推送通知。 我无法在手机中显示通知,我进行了注册,使用谷歌,我接收代码并将结果存储在mysql数据库中,我使用php发送通知,成功后,我收到以下消息:Android 提醒推送,android,notifications,push-notification,google-cloud-messaging,push,Android,Notifications,Push Notification,Google Cloud Messaging,Push,我正在android上开发一个应用程序,你可以注册接收推送通知。 我无法在手机中显示通知,我进行了注册,使用谷歌,我接收代码并将结果存储在mysql数据库中,我使用php发送通知,成功后,我收到以下消息: {"multicast_id":6686183359185983221,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1443999101817727%7f187d75f9fd7ecd"}]} 但我
{"multicast_id":6686183359185983221,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1443999101817727%7f187d75f9fd7ecd"}]}
但我的手机没有收到任何信息,这是我的Android清单的代码:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="it.worldsoccermanager"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="23" />
<!-- Needs internet to connect to Google Services -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Google Services requires a Google account -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Permission to vibrate when receive a notification -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Lets app receive data messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Creates a custom permission using "signature" so that only this app
can read the messages returned by GCM
- YOUR_PACKAGE is your product's package name. E.g. com.example.test -->
<permission
android:name="it.worldsoccermanager.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission
android:name="it.worldsoccermanager.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".LoginActivity"
android:label="@string/title_activity_login"
android:windowSoftInputMode="adjustResize|stateVisible" >
</activity>
<activity
android:name=".TeamHomeActivity"
android:label="@string/title_activity_team_home" >
</activity>
<activity
android:name=".NotificationActivity"
android:label="@string/title_activity_notification"
android:parentActivityName=".TeamHomeActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="it.worldsoccermanager.TeamHomeActivity" />
</activity>
<receiver
android:name=".NotificationReceiver">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="it.worldsoccermanager" />
</intent-filter>
</receiver>
提前感谢您提供的任何帮助您丢失了接收器上的权限
<receiver
android:name=".NotificationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="it.worldsoccermanager" />
</intent-filter>
</receiver>
您缺少对接收器的权限
<receiver
android:name=".NotificationReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="it.worldsoccermanager" />
</intent-filter>
</receiver>
否,这是明显的错误。它仍然不起作用吗?我只能在今晚看到,因为现在我在工作,在这里我不能尝试,我已经说过了,因为我想我已经尝试了你说的修改。非常感谢,我会尝试,希望这是解决方案,我快疯了!我真的不知道现在有什么问题!你确定注册id正确吗?你已经在谷歌控制台正确初始化了应用程序?问题解决了,是WI-FI路由器阻止了传入的消息。不,这是明显的错误。它仍然不起作用吗?我只能在今晚看到,因为现在我在工作,在这里我不能尝试,我已经说过了,因为我想我已经尝试了你说的修改。非常感谢,我会尝试,希望这是解决方案,我快疯了!我真的不知道现在有什么问题!你确定注册id正确吗?你已经在谷歌控制台正确初始化了应用程序?问题解决了,是WI-FI路由器阻止了传入的消息。