PushSharp OnNotificationSent事件在发送到Android的推送通知时不会触发,但在发送到iphone时触发

时间:2016-02-29 08:19:17

标签: c# pushsharp

我正在使用PushSharp库从.net发送PushNotification到android和iphone

我的机器人和iphone收到.net发送的推送通知,但是 .net OnNotificationSent事件只触发ios而不是android

    **My PushSharp registration code** 

  push = new PushBroker();
    push.OnNotificationSent += NotificationSent;
    push.OnChannelException += ChannelException;
    push.OnServiceException += ServiceException;
    push.OnNotificationFailed += NotificationFailed;
    push.OnDeviceSubscriptionExpired += DeviceSubscriptionExpired;
    push.OnDeviceSubscriptionChanged += DeviceSubscriptionChanged;
    push.OnChannelCreated += ChannelCreated;
    push.OnChannelDestroyed += ChannelDestroyed;

    push.RegisterGcmService(new GcmPushChannelSettings(ConfigurationSettings.AppSettings["PushNotificationApiKey"]));


    string basePath = AppDomain.CurrentDomain.BaseDirectory;
    string fullPath = Path.Combine(basePath, "Certificates/Certificate.p12");

    byte[] appleCert = File.ReadAllBytes(fullPath);
    push.RegisterAppleService(new ApplePushChannelSettings(false, appleCert, ""));

0 个答案:

没有答案