我无法在Android上的Unity应用程序中使用Push Notifications。我已经按照Parse文档中的步骤进行操作,包括设置AndroidManifest.xml。设备注册一个安装,我可以在仪表板上看到。但是,当使用仪表板创建推送时,递送报告总是为我的平板电脑显示“PPNS - OUTDATED DEVICE”。
我按照从这里创建AndroidManifest.xml文件的说明进行操作: https://www.parse.com/apps/quickstart#parse_push/unity/android/existing
我是否需要设置安装的“GCMSenderId”值?文档对此有点含糊不清。
以下是我的清单的内容:
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.unity3d.player"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<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.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:protectionLevel="signature"
android:name="com.unity3d.player.permission.C2D_MESSAGE" />
<uses-permission android:name="com.unity3d.player.permission.C2D_MESSAGE" />
<application
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:debuggable="true"> <!-- SET TO FALSE FOR RELEASE BUILD -->
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<service android:name="com.parse.ParsePushService" />
<receiver android:name="com.parse.ParsePushBroadcastReceiver"
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.unity3d.player" />
</intent-filter>
</receiver>
</application>
</manifest>
答案 0 :(得分:0)
无论如何,这是我的AndroidManifest.xml文件,供其他人使用Unity3D和Android设备解决Parse Push问题。
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yourcompany.yourproductname"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0">
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<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:protectionLevel="signature"
android:name="com.yourcompany.yourproductname.permission.C2D_MESSAGE" />
<uses-permission android:name="com.yourcompany.yourproductname.permission.C2D_MESSAGE" />
<application
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:debuggable="true"> <!-- SET TO FALSE FOR RELEASE BUILD -->
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<service android:name="com.parse.ParsePushService" />
<receiver android:name="com.parse.ParsePushBroadcastReceiver"
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.yourcompany.yourproductname" />
</intent-filter>
</receiver>
</application>
</manifest>
请注意,您将替换&#34; com.yourcompany.yourproductname&#34;的所有实例。使用您想要使用的任何包名称。