使用Parse的推送通知时,Android应用程序强制关闭

使用Parse的推送通知时,Android应用程序强制关闭,android,parse-platform,push-notification,Android,Parse Platform,Push Notification,自从我开始在android上使用Parse Push以来,我几乎没有遇到什么问题。 1.应用程序未在后台运行时,我无法发送通知。 2.应用程序强制关闭时,它不在后台运行,我发送推送通知。 3.当我点击收到的推送时,应用程序强制关闭 安卓清单 <service android:name="com.parse.PushService" /> <receiver android:name="com.parse.ParsePushBroadcastReceiver"

自从我开始在android上使用Parse Push以来,我几乎没有遇到什么问题。 1.应用程序未在后台运行时,我无法发送通知。 2.应用程序强制关闭时,它不在后台运行,我发送推送通知。 3.当我点击收到的推送时,应用程序强制关闭

安卓清单

<service android:name="com.parse.PushService" />
    <receiver android:name="com.parse.ParsePushBroadcastReceiver"
        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="cn.loptest" />
        </intent-filter>
    </receiver>
如果我对上述代码使用
PushService.setDefaultPushCallback
,我总是会得到一个“Connot Resolve Method”


首先是TIA。在公共论坛上发布应用程序密钥和密码对你来说不是个好主意。其次请发布来自崩溃的堆栈跟踪。@IvanWooll这不是我的应用程序密钥。我从中删除了许多字符。堆栈跟踪很快就会出现。我恢复到稳定的代码,以便继续使用其他功能。请在检查应用程序是否位于后台或前台的位置提供代码@NavneethT@Aashvi问题是我正在使用一个教程来实现push-through解析,它没有搜索应用程序是前台还是后台的代码。至于现在,如果应用程序在后台,那么推送是成功的。如果应用程序在两种状态下均未运行,并且我尝试发送推送,则会收到强制关闭消息。
Parse.initialize(this, "********", "*******");
    ParseInstallation.getCurrentInstallation().saveInBackground();