New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sent messages are not received #26
Comments
Going to need a lot more info on this one... |
ok, i try :) here some code: public class DeviceSettingsManager
} this is used to prepare the messages to be sent now I add some Messages Only the first device got the message and if you add "OnOnNotificationSent"-Event it only shows the first message. |
You are mixing C2DM classes with GCM classes. Make sure you are using the GcmPushService if you are using GcmPushChannelSettings I will add some type detection to make sure you get an exception in the future if you are using the wrong classes. |
Hi, ok I have change my class to GcmPushService but it does not change :( |
Please see the latest code / NuGet release 1.0.10. I've renamed some of the Android classes to be C2dm explicitly, and there's now type safety in the ctor's to ensure you don't use the incorrect settings types.... This should make it harder to accidentally use the wrong classes, but will require a few changes in your code |
Hi, |
Can you show me the code you use now? On Fri, Aug 10, 2012 at 10:00 AM, DarkPrisma notifications@github.comwrote:
|
using System; namespace PushServerTest
} it prints but it should be |
Please also register the following events and log them to Console.WriteLine and let me know if there's any more data: push.Events.OnDeviceSubscriptionExpired |
i've added them, but no change :( no new messages shown |
Ok let me do some testing and see if I can reproduce your results On Fri, Aug 10, 2012 at 10:28 AM, DarkPrisma notifications@github.comwrote:
|
It's not a perfect solution for now, but try putting a Thread.Sleep() before you call push.Stop(true). Maybe sleep for 2-3 seconds? In most cases I'd recommend you keep the instance of the service around instead of stopping it after you send messages. I'll take a look and see why Stop(true)... seems not to be waiting for the Queue to actually finish in the meantime... |
Hi, it seems that the problem is the Stop-Method of PushChannelBase.
it work as well. But why ? I think its simple, you make an async call to the google server because of the QueuedNotificationCount return 0 if no new messages are in it. This invokes the CancelTokenSource.Cancel(); and all running requests to the google server are canceled. We could maybe count the messages, to get save that we have send them all. EDIT: I have implemented some dirty counter and now it works :D EDIT2: Ok, it seems to be the same here, he delete the channels, which are working. If I disable the code in the TeardownChannel-Method, its all ok |
I will look at this as soon as I can, unfortunately I'm out of town for a week right now. |
So i did make some changes. I implemented a message counter for GCM and C2DM (since they both have the same side effect from sending messages ASYNC). I've also changed how the .Stop() method works a bit, in the PushChannelBase - Sender now doesn't exit until the notification Queue is zero, but also you will now get an exception if you try to queue a notification on a channel after you've already called stop on it. Please try your code again, it should work now. Thanks for digging up this issue too, as I believe it would have caused problems in iOS and WP7 as well :) |
Thank u! Now it works :) Great job! |
Hi,
if you try to send some messages in a short time, like for(...) QueueNotification()
not all messages are sent to the device
The text was updated successfully, but these errors were encountered: