I've been using Redth/PushSharp code to implement server side push for both Android and iPhone.
Using the following code:
foreach (Receipient in iOSUsers)
{
push.QueueNotification(NotificationFactory.Apple()
.ForDeviceToken(APNS_Device_Token_Of_Receipient)
.WithAlert("Alert!")
.WithSound("default")
.WithBadge(2));
}
foreach (Receipient in GCMUsers)
{
push.QueueNotification(NotificationFactory.AndroidGcm()
.ForDeviceRegistrationId(GCM_Device_Token_Of_Receipient)
.WithCollapseKey("NONE")
.WithJson("Alert!"));
}
My problem is that I'm able to send only to one platform at a time, the code above sends only to iPhone, and if the first loop is disabled than only Android users will get the push message.
Any clue?
I can add additional code if needed.
Thanks!