2013-10-01 5 views
2

Android 푸시 알림을 수신하지 못합니다. 나는 Android에서 푸시 알림을 수신하지 않음

  • 가 GCM에 장치 식별자를
  • 푸시 알림 메시지가 나타납니다
  • 장치를 등록

    • 수 있어요

    내가 성공적으로 알림 전송 이벤트에 입력하지만 메시지가 수신되지 나의 기기. 성공적인 푸시 코드는 다음과 같습니다.

    string apiKey = "API KEY HERE"; 
    push.RegisterGcmService(new GcmPushChannelSettings(apiKey)); 
    
    string load = "Hello World"; 
    int count = 2; 
    string dev = 'device identifier generated for device'; 
    string payload = "{\"alert\":" + "\"" + load + "\"" + ",\"badge\":" + "\"" + count + "\"}"; 
    //IMPORTANT: For Android you MUST use your own RegistrationId here that gets generated within your Android app itself! 
    GcmNotification note = new GcmNotification().ForDeviceRegistrationId(dev).WithJson(payload); 
    

    답변

    1

    모든 항목을 Android 측에서 설정했는지 확인하십시오. https://developer.android.com/google/gcm/gcm.html

    그 외에도 PushSharp에는 사용할 수있는 새 버전이 있습니다. https://github.com/Redth/PushSharp

    추적 할 이벤트를 추가하여 문제가 없는지 확인할 수도 있습니다.

     push.OnDeviceSubscriptionExpired += new DeviceSubscriptionExpiredDelegate(push_OnDeviceSubscriptionExpired); 
         push.OnDeviceSubscriptionChanged += new DeviceSubscriptionChangedDelegate(push_OnDeviceSubscriptionChanged); 
         push.OnChannelException += new ChannelExceptionDelegate(push_OnChannelException); 
         push.OnNotificationFailed += new NotificationFailedDelegate(push_OnNotificationFailed); 
         push.OnNotificationSent += new NotificationSentDelegate(push_OnNotificationSent); 
    

    그런 다음 안드로이드 측에서 logcat을 점검하여 메시지가 통과하는지 확인하십시오.

    뒤로 물러서서 장치 자체에서 푸시를 보내려고합니다. https://developer.android.com/google/gcm/client.html

    +0

    GCM에 접수되면 휴대 전화에 표시하기 위해 안드로이드 앱 측에서 수행해야 할 작업이있는 것처럼 보입니다. 메시지가 GCM으로 푸시되고 GCM이 메시지를 보냈지 만 안드로이드 앱이 메시지를 표시하지 않습니다. 도와 줘서 고마워. – user1453999