2015-06-17 411 views
0

我正在使用parse.com保存我的Unity3D遊戲的安裝(在Android設備上)。我想使用parse.com推送服務來管理推送通知。我能夠保存解析數據庫中的所有安裝解析核心Unity3D,Parse.com不發送推送通知到Android設備

當我嘗試將推送通知發送到我的Android設備時,它顯示結果0推送發送。

有沒有人知道可能是什麼原因造成的?

我的清單根據文檔中提供的指南進行結算。

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="18" android:versionName="1.1.7" package="com.imptrax.sniperoverkill3dassassinshooting" android:installLocation="preferExternal"> 
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" /> 
    <permission android:name="com.imptrax.sniperoverkill3dassassinshooting.permission.C2D_MESSAGE" android:protectionLevel="signature" /> 
    <uses-permission android:name="com.imptrax.sniperoverkill3dassassinshooting.permission.C2D_MESSAGE" /> 
    <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" android:debuggable="false" android:isGame="true" android:banner="@drawable/app_banner"> 
    <activity android:label="@string/app_name" android:name="com.unity3d.player.UnityPlayerActivity" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"> 
     <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> 
     </intent-filter> 
     <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> 
    </activity> 
    <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:name="com.facebook.unity.FBUnityLoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"> 
    </activity> 
    <activity android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:name="com.facebook.unity.FBUnityDialogsActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"> 
    </activity> 
    <activity android:configChanges="keyboardHidden|orientation" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"> 
    </activity> 
    <activity android:exported="true" android:name="com.facebook.unity.FBUnityDeepLinkingActivity"> 
    </activity> 
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 1550186055254706" /> 
    <activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:name="com.google.android.gms.ads.AdActivity" /> 
    <!-- Required by Chartboost --> 
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 
    <activity android:configChanges="orientation|keyboard|keyboardHidden" android:launchMode="singleTop" android:name="com.chartboost.sdk.CBDialogActivity" android:theme="@android:style/Theme.Translucent" android:windowSoftInputMode="adjustResize"> 
    </activity> 
    <activity android:configChanges="orientation|layoutDirection|keyboard|keyboardHidden|screenLayout|uiMode|screenSize" android:excludeFromRecents="true" android:name="com.chartboost.sdk.CBImpressionActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> 
    <activity android:configChanges="orientation|layoutDirection|keyboard|keyboardHidden|screenLayout|uiMode|screenSize" android:name="com.prime31.GoogleIABProxyActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" /> 
    <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" /> 
     <!-- 
     IMPORTANT: Change "com.parse.starter" to match your app's package name. 
    --> 
     <category android:name="com.imptrax.sniperoverkill3dassassinshooting" /> 
     </intent-filter> 
    </receiver> 
    </application> 
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="21" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="com.android.vending.BILLING" /> 
    <uses-feature android:glEsVersion="0x00020000" /> 
    <supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
    <uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" /> 
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" /> 
    <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" /> 
    <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" /> 
</manifest> 

它我的代碼爲C#語言編寫的統一

void Start() { 
    var installation = ParseInstallation.CurrentInstallation; 
    installation.SaveAsync(); 
    ParsePush.ParsePushNotificationReceived += (sender, args) => 
    { 
    #if UNITY_ANDROID 
     AndroidJavaClass parseUnityHelper = new AndroidJavaClass("com.parse.ParseUnityHelper"); 
     AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 
     AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); 
     // Call default behavior. 
     parseUnityHelper.CallStatic("handleParsePushNotificationReceived", currentActivity, args.StringPayload); 
    #endif 
    }; 
} 

回答

0

權限,並在您更改包推送通知登記使用許可權標籤

由於您在您的清單標籤副本中指定了一個包裝名稱,並將其置於此位置

com.unity3d.player.permission...... 

無論是在許可使用許可權

檢查是否有幫助

相關問題