我正在使用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, ""));