Search code examples
c#jsonpush-notificationgoogle-cloud-messagingpushsharp

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary while sending Push Notifiaction from PUSHSHARP


Getting Exception while send notification from server to gcm. as APNS notification are working fine.

apps["com.app.myAPP"].Gcm.QueueNotification(new GcmNotification
        {

            RegistrationIds = new List<string> {
         deviceId

        },
            Data = JObject.Parse(msg),


        });

Where

msg = "{ \"Somekey\" : \"somevalue\" }";

will highly thankful to you if someone help me to resolve this issue.


Solution

  • Issue Found

    I was not using correct app name apps["com.app.myApp"] .

    Thanks