[更新]
(當你讀我的問題,這是很好的瞭解)
我有一個小的編程錯誤,現在同類工作的錯誤的C2DM應用。但是在手機上的應用程序都收到了同樣的信息,從而有件事我忘了做C2DM爲什麼我的手機收到消息
[END更新]
我有一個C2DM的應用程序和服務器設置爲一個月,一切工作篦。 我有14個用戶/朋友註冊,並推動作品發現
當我運行下一版本的應用程序和服務器的另一臺計算機上創建沙箱時,我遇到了一些麻煩。
在沙箱上,我更改了應用程序的包名稱。
在我的手機上,我的兩個版本都安裝得很好,花花公子。
唯一的區別是沙箱版本應用程序正在與沙箱服務器通信(當然)。
爲什麼手機上的錯誤c2dm應用程序收到消息?
現在, 爲什麼非沙盒應用程序正在接收來自沙箱應用程序的消息?
對於像我這樣的業餘程序員來說,c2dm的文檔有時很難理解。
林困惑的:
public static final String EXTRA_APPLICATION_PENDING_INTENT = "app";
我應該寫在這裏包的名稱? 東西必須唯一標識這兩個應用程序的權利?
另一件我找不到答案/文件是registration_id。
我想一個手機只有一個registration_id,但可以有多個c2dm應用程序?
這是我的假設,很高興糾正我,如果我錯了。
如果問題出在我處理registration_id的方式或我發送推送消息的方式,我會感到困惑。不知道從哪裏開始?
[更新] ...
<receiver android:name="com.google.android.c2dm.C2DMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<!-- Receive the actual message -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.bent.blaster" />
</intent-filter>
<intent-filter>
<!-- Receive the registration id -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.bent.blaster" />
</intent-filter>
</receiver>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bent.blaster"
android:versionCode="1"
android:versionName="0.52"
android:installLocation="preferExternal">
<permission android:name="com.bent.blaster.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.bent.blaster.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-sdk android:minSdkVersion="8" />
@advantej感謝您在c2dm上的精彩博客。 – Erik