我正在做跨平台应用程序,我目前的工作是继续实施推送通知。我能够从服务器看到消息确认是肯定的。
MessageResult:MulticastResult(multicast_id=somenumber,total=1,success=1.failure=0.canonical_ids=0,results:[[messageID=somenumber]])
此success=1
条消息已成功推送至GCM
服务器,但对于IOS
则不是问题。
偶尔我会收到通知。我无法通过移动数据或GCM跟踪哪个区域出错。任何技术人员都面临这种情况?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.mobile"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission
android:name="com.company.mobile.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.company.mobile.permission.C2D_MESSAGE" />
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.company.mobile.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
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="com.company.mobile.ScreenOrientation" >
</activity>
<activity android:name="com.plugin.gcm.PushHandlerActivity" />
<receiver
android:name="com.plugin.gcm.CordovaGCMBroadcastReceiver"
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.company.mobile.monitor" />
</intent-filter>
</receiver>
<service android:name="com.plugin.gcm.GCMIntentService" />
</application>
</manifest>
答案 0 :(得分:1)
几天后我发现了问题,并提出了解决方案。 GCM是可靠的,唯一的问题是设备。我们需要检查
一些提示here