Xamarin.Android 集成 Parse Server 实现 GCM 推送:清单文件错误
Hey there, let’s work through that manifest error you’re facing with your Parse Server (hosted on Heroku) and GCM push notification setup. Since manifest issues are often tied to missing permissions, misconfigured receivers, or version mismatches, I’ll break down the most common pitfalls to check first:
Missing Critical Permissions
Ensure yourAndroidManifest.xmlincludes all required permissions for GCM/Parse push:<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- Replace YOUR_PACKAGE_NAME with your app's actual package name --> <permission android:name="YOUR_PACKAGE_NAME.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="YOUR_PACKAGE_NAME.permission.C2D_MESSAGE" />Incorrect Broadcast Receiver Setup
Parse relies on specific receivers to handle GCM push events. Verify you’ve added these inside the<application>tag:<!-- Parse Push Event 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.DELETE" /> <action android:name="com.parse.push.intent.OPEN" /> </intent-filter> </receiver> <!-- GCM Registration & Message 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" /> <!-- Replace YOUR_PACKAGE_NAME with your app's package --> <category android:name="YOUR_PACKAGE_NAME" /> </intent-filter> </receiver>Mismatched Sender ID
Double-check that the sender ID you’re using to initialize Parse in your app matches the project number from your Google Cloud Console (the one linked to your GCM/FCM setup). A mismatch here will cause registration failures and manifest-related errors.Android Version Compatibility
If you’re targeting Android 12 (API 31) or higher, older Parse SDK versions might not support the new broadcast receiver restrictions. Make sure you’re using the latest compatible Parse SDK, and that your receivers are configured with explicit intent filters or marked correctly (e.g.,android:exported="true"if needed for system intents).
If you’ve gone through these checks and still see the error, sharing the exact error message from Logcat or your build logs, plus a snippet of your relevant AndroidManifest.xml code, will help zero in on the exact problem.
内容的提问来源于stack exchange,提问作者upTheIrons

