Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 01 2022 08:32
    yurart commented #829
  • Dec 01 2022 08:31
    yurart commented #829
  • Oct 08 2022 05:11
    kikaragyozov commented #923
  • Oct 08 2022 04:57
    kikaragyozov commented #923
  • Oct 08 2022 04:57
    kikaragyozov commented #923
  • Oct 08 2022 04:42
    kikaragyozov commented #923
  • Aug 25 2022 18:15
    netwang commented #645
  • Aug 18 2022 15:20
    nazarii-piontko closed #753
  • Jul 11 2022 13:42
    spyro89 commented #870
  • Jul 11 2022 13:26
    spyro89 commented #870
  • Jun 30 2022 11:20
    tomkocyan commented #934
  • Jun 29 2022 13:59
    RosenDev commented #934
  • Jun 22 2022 16:35
    Build #28 passed
  • Jun 22 2022 16:34
    Build #27 passed
  • Jun 22 2022 16:34
    Build #27 passed
  • Jun 22 2022 16:33
    Build #26 passed
  • Jun 22 2022 16:32
    Build #26 passed
  • Jun 22 2022 16:32
    Build #26 passed
  • Jun 22 2022 16:31
    Build #26 passed
  • Jun 22 2022 16:31
    Build #25 passed
GeoffArmstrong
@GeoffArmstrong
Also, I recommend the classic blog post "How To Ask Questions The Smart Way" by Eric S. Raymond. Especially the "Before You Ask" part.
Bardia Noohi
@BNoohi
Well said. Also, there is a migration guide and additional examples in the tests for the implementation in the github repo
Denis Ibragimov
@h0useRus

@GeoffArmstrong are you using direct sending, like Start() send what you want then Stop() ?

In my scenario we have 10 different APN/GCM channels where we sending messages from one centralized queue. In V2 we never called Stop() and PN automatically clean internal receiving queues. Memory was pretty stable with spikes only during sending.

After migration to V4 I keep code which create all of ours 10 channels as single tones and once it created then instatly call Start(), and only in Dispose (which called only on stopping App pool) we call Stop(). Other code we kept the same. As result we faced with random message duplication + memory permanetly growing, seems PN queues never fully flushed.

Shahman Teh
@ShahmanTeh
Good day everyone. we had an issue with sending GCM payload out after migrating to our new server. it seems after we've sending our payload, we hit an exception on method PushSharp.Google.GcmServiceConnection.Send() Line 58 where var response = await http.PostAsync (Configuration.GcmUrl, content);
the exception generated was the following System.Net.WebException: Error writing request: The authentication or decryption has failed.
anyone can assist us on this matter? we've tested this on our previous server and it can run ok.
Rob Maas
@robmaas
Hello @Redth Any reason why the ServiceBroker Start() and Stop() methods aren't included in the IServiceBroker Interface? I'm running into this because I use brokers in a Generic way.
Jonathan Dick
@Redth
not really, but there you go, merged, thanks :)
Rob Maas
@robmaas
Cool thanks
How/when will this reflect to a release in Nuget?
Rob Maas
@robmaas
Added some more missing methods to the interface.
GeoffArmstrong
@GeoffArmstrong
@h0useRus I've got a APNS broker and GCM broker, I start them up when my push service gets started (it's a c# console app), I queue messages as required, and stop the APNS and GCM brokers on Dispose().
Denis Ibragimov
@h0useRus
@GeoffArmstrong I have fully automated WebAPI services, I can not predict when messages will come and when it finished. I have only option to Start()/Stop() for each message then. I can not find any proper solution for PN 4.0 to use it with webservices :(
Rob Maas
@robmaas
@Redth Hello Jonathan, I did some significant cleanup of the usage of INotification and TNofication
That should greatly improve the possibility of using generic approaches in the Brokers
Rob Maas
@robmaas
This comes with 1 problem though. The brokers can no longer return the TNotifcation in the OnNotificationSucceeded and OnNotificationFailed handlers, they will return INotification instead.
Rob Maas
@robmaas
That would mean that direct use of any of the brokers would require a cast inside the eventhandlers, like so: (INotification notification) => { ApnsNotification iosNotification = notification as INotification; }
What are your thoughts on this?
If you want to take a look at it: https://github.com/robmaas/PushSharp
Jonathan Dick
@Redth
hmm… that doesn’t seem like the worst thing, but it’s not super obvious
GeoffArmstrong
@GeoffArmstrong
@h0useRus The PushSharp notification docs said that running PushSharp in IIS is a poor choice. It was based on that suggestion that I made a separate process to run PushSharp in (this was back in 2.x) and I continued forward with that strategy. I'm running my app on Azure App Service, and PushSharp lives in a continuous webjob. If you're having problems with PushSharp, perhaps a good first step would be to follow the implementation recommendations and not host it in a IIS process. Or, if that's not an option, perhaps PushSharp isn't for you.
Michael Flynn
@cblaze22
Any good tutorials out there on using the new version of Pushsharp and Firebase? Seems like there is old documentation everywhere.
Jonathan Dick
@Redth
just change the endpoint server address to the firebase one and use gcm
Michael Flynn
@cblaze22
Cool thanks.
nishantasicom
@nishantasicom_twitter
Hello, I am using version 4.0.10 I am using same code in pushsharp github page for ios, notification sent but nothing receieve to me
Please help ?
Pleeeaaseee anyone help me ?
Bardia Noohi
@BNoohi
We can't debut your code for you, more so without the code. Have you looked through the examples and tests in the repo to compare? Have you checked the event listeners to see what you're getting?
nishantasicom
@nishantasicom_twitter
Yes I looked through all example and I already copy and paste same code from github
How can I check the event listener ?
Bardia Noohi
@BNoohi
...it's in the examples.
nishantasicom
@nishantasicom_twitter
could you please share with me an example about listeners ?
nishantasicom
@nishantasicom_twitter
If you are talking about OnNotificationSucceeded or failed
its always says notification sent nothing more
Bardia Noohi
@BNoohi
Yes, those are them. My assumption would be you are trying to send apple notifications? If so, make sure you are using the right certificate.
nishantasicom
@nishantasicom_twitter
yes I am trying to send apple noty and I am sure that rigth certificate from apple I get
there is no error OnNotificationSucceeded event fired and log to "Notification Sent"
try
{
var config = new ApnsConfiguration(ApnsConfiguration.ApnsServerEnvironment.Production, File.ReadAllBytes(AppDomain.CurrentDomain.BaseDirectory + "\newpushcer.p12"), "Moda2016");
var apnsBroker = new ApnsServiceBroker(config);
            apnsBroker.OnNotificationFailed += (notification, aggregateEx) =>
            {

                aggregateEx.Handle(ex =>
                {
                    var exception = ex as ApnsNotificationException;
                    if (exception != null)
                    {
                        var notificationException = exception;
                        var apnsNotification = notificationException.Notification;
                        var statusCode = notificationException.ErrorStatusCode;
                        LogManager.LogManager.Instance.Log(LogLevel.Error, exception.Message);

                    }
                    else
                    {
                        LogManager.LogManager.Instance.Log(LogLevel.Error, ex.Message);
                    }
                    return true;
                });
            };

            apnsBroker.OnNotificationSucceeded += (notification) =>
            {
                LogManager.LogManager.Instance.Log(LogLevel.Error, "Notification Sent");
            };

            apnsBroker.Start();

            foreach (var deviceToken in entity.DeviceTokens)
            {
                apnsBroker.QueueNotification(new ApnsNotification
                {
                    DeviceToken = deviceToken,
                    Payload = JObject.Parse("{\"aps\":{\"badge\":1,\"sound\":\"sound.caf\",\"alert\":\"" + entity.Body + "\"}}")
                });
            }

            apnsBroker.Stop();
        }
        catch (Exception e)
        {
            LogManager.LogManager.Instance.Log(LogLevel.Error, e.Message);
        }
this is my code
sorry
public void SendPush(PushEntity entity)
{
try
{
var config = new ApnsConfiguration(ApnsConfiguration.ApnsServerEnvironment.Production, File.ReadAllBytes(AppDomain.CurrentDomain.BaseDirectory + "\newpushcer.p12"), "Moda2016");
var apnsBroker = new ApnsServiceBroker(config);
            apnsBroker.OnNotificationFailed += (notification, aggregateEx) =>
            {

                aggregateEx.Handle(ex =>
                {
                    var exception = ex as ApnsNotificationException;
                    if (exception != null)
                    {
                        var notificationException = exception;
                        var apnsNotification = notificationException.Notification;
                        var statusCode = notificationException.ErrorStatusCode;
                        LogManager.LogManager.Instance.Log(LogLevel.Error, exception.Message);

                    }
                    else
                    {
                        LogManager.LogManager.Instance.Log(LogLevel.Error, ex.Message);
                    }
                    return true;
                });
            };

            apnsBroker.OnNotificationSucceeded += (notification) =>
            {
                LogManager.LogManager.Instance.Log(LogLevel.Error, "Notification Sent");
            };

            apnsBroker.Start();

            foreach (var deviceToken in entity.DeviceTokens)
            {
                apnsBroker.QueueNotification(new ApnsNotification
                {
                    DeviceToken = deviceToken,
                    Payload = JObject.Parse("{\"aps\":{\"badge\":1,\"sound\":\"sound.caf\",\"alert\":\"" + entity.Body + "\"}}")
                });
            }

            apnsBroker.Stop();
        }
        catch (Exception e)
        {
            LogManager.LogManager.Instance.Log(LogLevel.Error, e.Message);
        }
    }
nishantasicom
@nishantasicom_twitter
@BNoohi do you think is there any error ?
Bardia Noohi
@BNoohi
I don't readily see one. You're not even receiving one on your device? One thing to note is you only need to start and stop each broker once if you expect to keep using them.
nishantasicom
@nishantasicom_twitter
I do not even take one
this code fire only when user message to another user
Albilaga Linggra Pradana
@albilaga
hey, anybody know how to send wns raw notification? any example?
Michael Flynn
@cblaze22
Do I have to supply a device token even when sending to just a topic?
Andy
@andyste1
I'm developing a proof of concept web service that will be used to send GCM (and eventually APNS) notifications. I'm using the sample GCM code from the github site home page, but I wasn't sure if calling gcmBroker.Start() and Stop() as part of each send is still the right thing to do in a web application scenario? Or is it only necessary to call them on application startup & shutdown?
Bardia Noohi
@BNoohi
The latter