gpt4 book ai didi

java - logcat 报告推送未正确启用

转载 作者:行者123 更新时间:2023-12-02 04:25:57 26 4
gpt4 key购买 nike

我使用 Parse 作为我的应用程序的后端,并且我使用了他们的 quick start guide设置推送通知。

我已经一步一步地跟着它了,没有得到插入。当我启动应用程序时,我还在 logcat 中收到此报告

08-22 18:46:34.785    4325-4325/maxbleggi.afstudentplanner D/com.parse.ParsePushChannelsController﹕ Tried to subscribe or unsubscribe from a channel, but push is not enabled correctly. Push is not configured for this app because the app manifest is missing required declarations. Please add the following declarations to your app manifest to use GCM for push: make sure that these permissions are declared as children of the root <manifest> element:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="maxbleggi.afstudentplanner.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="maxbleggi.afstudentplanner.permission.C2D_MESSAGE" />
Also, please make sure that these services and broadcast receivers are declared as children of the <application> element:
<service android:name="com.parse.PushService" />
<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="maxbleggi.afstudentplanner" />
</intent-filter>
</receiver>
<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.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</intent-filter>
</receiver>

但我遵循了指南,并且我相信我的 list 是正确的

在这里

<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="maxbleggi.afstudentplanner" >

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<permission
android:name="maxbleggi.afstudentplanner.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="maxbleggi.afstudentplanner.permission.C2D_MESSAGE" />

<application
android:name=".utils.InitializeParse"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".activities.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=".activities.RegisterActivity"
android:label="@string/title_activity_register" >
</activity>
<activity
android:name=".activities.RegisterPart_2Activity"
android:label="@string/title_activity_register_part_2" >
</activity>
<activity
android:name=".activities.RegisterPart2TeacherActivity"
android:label="@string/title_activity_register_part2_teacher" >
</activity>
<activity
android:name=".activities.SplashScreenActivity"
android:label="@string/title_activity_splash_screen" >
</activity>
<activity
android:name=".activities.RegisterPart_3TeacherActivity"
android:label="@string/title_activity_register_part_3_teacher" >
</activity>

<!--<meta-data android:name="com.parse.push.notification_icon"/>
android:resource="@drawable/ic_stat_bt"-->

<service android:name="com.parse.PushService" />

<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.RECEIVE_BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>

<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.OPEN" />
<action android:name="com.parse.push.intent.DELETE" />
</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="maxbleggi.afstudentplanner" />
</intent-filter>
</receiver>

</application>

</manifest>

这是我开始解析的地方

    ...
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
ParseInstallation.getCurrentInstallation().saveInBackground();

ParsePush.subscribeInBackground("", new SaveCallback()
{
@Override
public void done(ParseException e)
{
if (e == null)
{

} else
{

}
}
});

当我使用我的设备时,我没有收到此 logcat 报告,但当我使用模拟器时,我确实收到了它

最佳答案

如果使用 Genymotion作为模拟器并且它没有安装 Google Apps,这可能会导致问题。尝试Install ARM translation并再次检查。更多信息请参见Unable to get push notification when using Genymotion as my emulator of my android app

关于java - logcat 报告推送未正确启用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32161596/

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