Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jul 11 13:42
    spyro89 commented #870
  • Jul 11 13:26
    spyro89 commented #870
  • Jun 30 11:20
    tomkocyan commented #934
  • Jun 29 13:59
    RosenDev commented #934
  • Jun 22 16:35
    Build #28 passed
  • Jun 22 16:34
    Build #27 passed
  • Jun 22 16:34
    Build #27 passed
  • Jun 22 16:33
    Build #26 passed
  • Jun 22 16:32
    Build #26 passed
  • Jun 22 16:32
    Build #26 passed
  • Jun 22 16:31
    Build #26 passed
  • Jun 22 16:31
    Build #25 passed
  • Jun 22 16:30
    Build #24 passed
  • Jun 22 16:30
    dependabot[bot] labeled #940
  • Jun 22 16:30
    dependabot[bot] opened #940
  • Jun 22 16:30

    dependabot[bot] on nuget

    Bump Newtonsoft.Json from 7.0.1… (compare)

  • Jun 22 16:29
    Build #23 passed
  • Jun 22 16:29
    dependabot[bot] labeled #939
  • Jun 22 16:29
    dependabot[bot] opened #939
  • Jun 22 16:29

    dependabot[bot] on nuget

    Bump Newtonsoft.Json from 7.0.1… (compare)

Stelios Ioannou
Burhan UĞUR
@Redth When are you going to accept pull requests?
Al Yaros
Hey, I have several millions of push request to send - How do I prevent the broker Queue to throw out-of-memory exception?
The internal blocking queue has unbounded capacity. for example I have stream of requests I would like to send, I take each element from the stream and enqueue it in the broker, the broker has unbounded capacity so eventually all my items will get into the broker memory cause it to ran out of memory. The broker is not fast as the incoming stream of requests. bottom line - how to throttle push sharp broker? I think that allowing library client to set bounded capacity on the broker queue would solve this issue.
Any Ideas?
Denis Ibragimov
thats biggest problem of arhitecture of PushSharp 4, second version was much better with queue, I tried to play with Start/Stop for portion of messages, but then push sharp stopped send anything. My system with push sharp taking 5-10 gigs of memory during sending about ~7 mil messages per day, with version two it was only 700 megs!!! But version two do not support new Apple certificates.
Let me start over... Is there a good way to make a collection of ServiceBrokers, which are actually concrete ApnsBroker and GCMBroker objects?
given the way generics are setup in PushSharp, it doesn't seem possible
I need to do this on account of multiple applications, as well as the ideally long-lived nature of the broker
Denis Ibragimov
I did exactly like this and made base class
public abstract class PushChannelBase<T> : ISendChannel<MessageData>, IDisposable where T : INotification
        protected static readonly Log log = Log.GetLogger<PushChannelBase<T>>();

        protected bool IsDisposed;
        protected readonly ServiceBroker<T> Broker;
        public virtual ChannelSetting[] Settings => ApplicationSettings.Settings;
        public ApplicationSetting ApplicationSettings { get; }
        public Guid ApplicationID => ApplicationSettings.ID;
        public string Name => ApplicationSettings.Name;
        public bool IsInitialized => Broker != null;

        public virtual ChannelResult SendData(IEnumerable<MessageData> data)
            foreach (var message in data)
            return new ChannelResult { Status = StatusCodes.Success };

        public abstract ChannelResult SendData(MessageData data);

        protected PushChannelBase(ApplicationSetting settings)
            ApplicationSettings = settings;
            Broker = CreateBroker(settings);
            if (Broker == null)
                throw new NullReferenceException("Push service not initialized!");
            Broker.OnNotificationSucceeded += OnNotificationSuccess;
            Broker.OnNotificationFailed += OnNotificationFailed;

        protected abstract ServiceBroker<T> CreateBroker(ApplicationSetting settings);
        protected abstract void OnNotificationFailed(T notification, AggregateException exception);
        protected abstract void OnNotificationSuccess(T notification);

        protected virtual void OnError(int statusCode, MessageData data, Exception exception)
            var response = new ResponseData
                Code = statusCode,
                MessageID = data.ID,
                Message = exception.SerializeToJson(),
                By = data.UserID

        protected virtual void RegisterMessage(T notification, int errorCode, string errorMessage)
            SendProvider.SendStatus(MakeResultResponse(notification, errorCode, errorMessage));

        protected abstract ResponseData MakeResultResponse(T notification, int errorCode, string errorMessage);
        public virtual void Dispose()
            if (!IsDisposed)
                IsDisposed = true;
hi all
is here for chat ?
any examples of sending with PS directly w/o using a Broker?
we already have a queue mechanism, and I'm trying to keep our system as abstract WRT platforms as possible
hrm, looks like the async part goes all the way to the bottom - not sure how useful it would be to send w/o a broker anyways...
Hi. Can someone help me please? i would like to know if the Pushsharp can read .p8 certificates. If not, how can i read a .p8 certificate and convert it into a X509Certificate2?
It is quite urgent and i will accept all the help you can give me please.
By the way, i'm trying to use the communications with the APNs server.
Selçuk Ermaya
Jonathan Dick
woo figured out why mono debugging in vscode wasn’t hitting breakpoints set in the editor...
Hi John. Now that ALPN is available in .net core 2.0 do you think we can progress this further. I am more than happy to put in my efforts alongside you and everyone else. I really hope we build the new version with support for proxy
Hi All - trying to get the tests running but they fail as there is no settings.json file and the project references a ghost file. Anyone got a sample I can use? Trying to work out how to integrate this library into an existing dotnet project to send notifications to ipads. thnx
btw i've got the sample, just not sure what should go in it ;-)
Hi All, I m trying to push over 500 K notification, but it takes over 10 minutes in v4.0 while with v2.0 it takes 2-3 minutes over all.
I tried to change scale up to 50 or keep it 10 and increase the thread - task count but could not decrease the time elapsed.
Application is run on 8 Gb, 2.3 Ghz server.
Do you have any suggestions ?
Thank you!
@Redth Got a working codebase now :-) - one more question (if anyone is listening?), how do I actually test this is sending out? The logs say notification sent, however the app dev says nothing is being received - is there a way I can test this locally to ensure it's working?
Bono Pomodoro
Hey guys, does anyone have an example of usage of PushSharp for Xamarin Forms? For all three platforms :)
Can someone give me an idea on how to resend failed notifications that are caught by the exception events. For example when either of these exceptions are caught - GcmNotificationException/GcmMulticastResultException/RetryAfterException. Do I need to restart the broker in order to resend them or is it handled automatically.
I'm using 4.0
Adam J. Mendoza
@Redth I've been away for a while. I'll take a look at the repo now
@SimonAntony Are you still working on this? Are you testing APNS or Google?
Adam J. Mendoza
@SimonAntony for APSN I'd test the actual key apart from PushSharp to make sure all is good with the APNS and key. If that works then you should be able to receive notifications on a device
Thanks @adammendoza - all working now and live
Federico Di Gregorio
Hi. Does PushSharp work with netcoreapp2.0 console applications?
Adam J. Mendoza
@SimonAntony Did you migrate the code to dotnet core? If so is it on github?
@SimonAntony did you have to make any changes to the codebase to get it to work with APSN?
@adammendoza no just used what was in the repo
@sktyjd Nope, found a couple of examples on the net so used as a basis
Paul Arizpe
Hi, how can use .p8 certificate with PushSharp ?? anyone have a Example :D
Adam J. Mendoza
@SimonAntony Cool! does that mean that it works with dotnet core as is?
Hey guys, I just ran across this library. I just cloned it, how can i send a test message to a dev device. I know its a silly question, im just not sure how to start building into this
Hi guys. I'm having a problem validating my certificate to APNS with this nuget. My certificate works when using PHP and when using Sockets. Couldn't find anything on the web
Alex P
Hi there! Are the project alive?
last commit at 1 Dec 2016
Unfortunately Redth/PushSharp#702 http/2 not supported yet =(
Joshua Russo
@SanSYS The project is still alive I believe. The primary maintainer (Redth) is just not working on a project where he needs push notifications, so his attention is pulled else where
hello, i want to build an app that is get push notification question, how do i start?
Hi All. Seems like APNS does not support tls1.2, is that true?
I tried to install PushSharp 4.0.10 Nuget package in Visual Studio 2017, it shows error: Package restore failed. Rolling back package changes for 'Project1'. How to resolve this issue? 0
To begin building a push notification app, try a tutorial like:
Ray Wenderlench
Ajay Kumar
I have installed PushSharp 4.0.10 Nuget package in Visual Studio 2017 and I have only enable TLS 1.2 (Means A+ rating on server) then i don't get apns notification on server and when i have enable TLS 1.0 with TLS 1.2 then notification is working. please help me how can I get apns notification when only TLS 1.2 enable.