我目前也在尝试解决与 Urban Airship 插件相关的问题。
根据 Prime 31 的说法,事情似乎应该开箱即用。但您可能已经注意到,GCM 支持已被弃用,Prime 的插件仍然依赖于 C2DM。
也许您还应该在以下论坛帖子上发帖,因为这是关于该主题的讨论。
话虽如此,即使 GCM 帐户不正确,我也可以让我的 APID 做出响应。但我无法收到任何推送通知。更具体地说,androidManifest.xml 的某些部分需要保持不变。这是我的 androidManifest.xml 配置:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myCompany.myGame" 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"/>
<!-- The com.prime31.EtceteraApplication should be there -->
<application android:name="com.prime31.EtceteraApplication"
android:icon="@drawable/app_icon"
android:label="@string/app_name"
android:debuggable="true">
<!-- These activities should be in there -->
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.unity3d.player.UnityPlayerActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity"
android:label="@string/app_name"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.unity3d.player.VideoPlayer"
android:label="@string/app_name"
android:screenOrientation="behind"
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
</activity>
<!-- ACTIVITIES -->
<activity android:name="com.prime31.EtceteraProxyActivity"></activity>
<activity android:name="com.prime31.WebViewActivity" android:configChanges="orientation"></activity>
<activity android:name="com.prime31.P31VideoPlayerActivity" android:configChanges="keyboard|keyboardHidden|orientation"></activity>
<receiver android:name="com.urbanairship.CoreReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
</intent-filter>
</receiver>
<receiver android:name="com.urbanairship.push.c2dm.C2DMPushReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.myCompany.myGame" />
</intent-filter>
<intent-filter>
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.myCompany.myGame" />
</intent-filter>
</receiver>
<service android:name="com.urbanairship.push.PushService" android:process=":com.urbanairship.push.process" />
<receiver android:name="com.prime31.P31UAIntentReceiver" />
</application>
<uses-feature android:glEsVersion="0x00010001" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
<permission android:name="com.myCompany.myGame.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="com.myCompany.myGame.permission.C2D_MESSAGE"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
如果您设法让推送通知正常工作,请告诉我,因为我无法让这部分工作!干杯!