Parse.com推送通知不起作用

问题描述:

我无法接收推送通知。我的接收器类中的onPushReceieved方法永远不会被调用。Parse.com推送通知不起作用

这里是我的表现是什么样子:

<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 

    <permission android:protectionLevel="signature" 
     android:name="com.compName.appName.permission.C2D_MESSAGE" /> 
    <uses-permission android:name="com.compName.appName.permission.C2D_MESSAGE" /> 

<application> 
    . 
    . 


    <service android:name="com.parse.PushService" /> 
    <receiver android:name="com.compName.appName.helpers.MyParsePushReciever" 
     android:exported="false"> 
     <intent-filter> 
      <action android:name="com.parse.push.intent.RECEIVE" /> 
      <action android:name="com.parse.push.intent.DELETE" /> 
      <action android:name="com.parse.push.intent.OPEN" /> 
     </intent-filter> 
    </receiver> 
    <receiver android:name="com.parse.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.compName.appName" /> 
     </intent-filter> 
    </receiver> 
</application 

这是解析的init方法在我的应用onCreate方法:

Parse.initialize(this, app_id, client_id); 
    PushService.startServiceIfRequired(this); 
    ParseInstallation.getCurrentInstallation().saveInBackground(); 

这里是我的接收机类的onPushReceived方法:

@Override 
protected void onPushReceive(Context context, Intent intent) { 

    Log.i("hereeeeeeeeee === ", "on push recieve"); 

} 

我永远无法看到日志。 OnPushReceive永远不会被调用。有什么我失踪?

+0

检查你的清单我认为软件包名称是错误的。我是从解析推送的经验来讲的。 –

+0

你能更具体吗?谢谢 –

+0

更改接收器名称从“com.compName.appName.helpers.MyParsePushReciever”为“com.parse.ParsePushBroadcastReceiver” –

检查您的清单和gradle文件,我认为软件包名称是错误的。

+0

编辑提出:包括gradle文件 –

我听说parse.com将是永远关闭

和是其打倒正式。 http://parse.com/

enter image description here

编辑

由于parse最近宣布其停产,GCM是唯一最好的选择,虽然它不会配备了一个管理界面。 你可以按照这个真棒教程。 http://www.androidhive.info/2016/02/android-push-notifications-using-gcm-php-mysql-realtime-chat-app-part-1/

+0

我知道这一点。但我只需要它用于演示目的。我只需要暂时解析工作。 –

+0

:D报告为此解析。可能是他们回复您的报告并恢复其临时基地的服务。 –

+0

不要等待这个。这不会发生。按照教程为此创建自己的管理界面。或者你可以找到其他服务,如parse.com –

我想通了。

很久以前,我改变了我的包装。我已经对我的清单进行了更改,但未在我的gradle文件中进行更改。

大声呼吁Taylor Courtney继续帮助我解决问题。他是真正的MVP。