2013-04-18 3 views
0

장치를 다시 설치/설치할 때 Google에서 다른 장치 ID를 보내므로 동일한 장치를 가리키는 데이터베이스 테이블에 여러 개의 다른 장치 ID가 있습니다. 어떤 기기가 여러 개의 알림을 받아서 내게 너무 많은 상처를 주었기 때문에 Google에 단일 장치로 하나의 알림 만 보내는 방법이 있습니까? 또는 요청을 보내기 전에 ID가 신규 또는 오래된 지 확인하는 방법이 있습니까? 이 이상한 문제를 경험 한 사람이 있습니까? BTW, 나는 PushSharp/ASP.NET 백엔드에서 사용하고 있습니다.(GCM) Google Notification Server에서 다중 알림을 받고 있습니까?

업데이트 : 현재 기본 장치 ID를 사용 중입니다. 따라서 기존 장치 ID가 동일한 데이터베이스 테이블에서 이전 등록 ID를 제거하거나 바꿉니다.

답변

1

등록되지 않은 오류 코드가 발생하면 데이터베이스에서 장치 ID를 제거해야한다고 생각합니다.

Unregistered Device 
An existing registration ID may cease to be valid in a number of scenarios, including: 
If the application manually unregisters by issuing a com.google.android.c2dm.intent.UNREGISTER intent. 
If the application is automatically unregistered, which can happen (but is not guaranteed) if the user uninstalls the application. 
If the registration ID expires. Google might decide to refresh registration IDs. 
If the application is updated but the new version does not have a broadcast receiver configured to receive com.google.android.c2dm.intent.RECEIVE intents. 
For all these cases, you should remove this registration ID from the 3rd-party server and stop using it to send messages. 
Happens when error code is NotRegistered. 

메시지를 장치에 보낼 때 오류 코드를 처리하는 것이 좋습니다.

http://developer.android.com/google/gcm/gcm.html

제 3 자 서버의 역할을 읽어 보시기 바랍니다. 더 자세한 정보를 얻을 수 있습니다.

+0

감사합니다. 이 문제를 해결하려면 기본 장치 ID를 사용해야한다고 생각합니다. http://stackoverflow.com/questions/15744807/gcm-device-registration-issue-in-android – user2293609