gpt4 book ai didi

java - Parse.com 推送通知不起作用

转载 作者:行者123 更新时间:2023-12-01 21:50:12 25 4
gpt4 key购买 nike

我根本无法接收推送通知。我的接收器类中的 onPushReceieved 方法从未被调用。

这是我的 list :

<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

这是我的应用程序 onCreate 方法中 Parse 的 init 方法:

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

这是我的 Receiver 类的 onPushReceived 方法:

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

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

}

我永远看不到那个日志。 OnPushReceive 永远不会被调用。我有什么遗漏的吗?

最佳答案

检查你的manifest和gradle文件,我认为包名称是错误的。

关于java - Parse.com 推送通知不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35348900/

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