Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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)

  • Jun 22 16:29
    dependabot[bot] opened #938
  • Jun 22 16:29
    dependabot[bot] labeled #938
Denis Ibragimov
@h0useRus
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)
            {
                SendData(message);
            }
            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;
            Broker.Start();
        }

        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)
        {
            log.Error(exception);
            var response = new ResponseData
            {
                Code = statusCode,
                MessageID = data.ID,
                Message = exception.SerializeToJson(),
                By = data.UserID
            };
            SendProvider.SendStatus(response);
        }

        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)
            {
                Broker?.Stop();
                IsDisposed = true;
            }
        }
    }
TarrahArshad
@TarrahArshad
hi all
is here for chat ?
levl289
@levl289
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
levl289
@levl289
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...
Donnie7
@Donnie7
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
@se
Jonathan Dick
@Redth
woo figured out why mono debugging in vscode wasn’t hitting breakpoints set in the editor...
jay1050
@jay1050
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
SimonAntony
@SimonAntony
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 ;-)
msadikkose
@msadikkose
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!
SimonAntony
@SimonAntony
@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
@BonoPomodoro_twitter
Hey guys, does anyone have an example of usage of PushSharp for Xamarin Forms? For all three platforms :)
S.Stratis
@spstratis
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
@adammendoza
@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
@adammendoza
@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
SimonAntony
@SimonAntony
Thanks @adammendoza - all working now and live
Federico Di Gregorio
@fogzot
Hi. Does PushSharp work with netcoreapp2.0 console applications?
Adam J. Mendoza
@adammendoza
@SimonAntony Did you migrate the code to dotnet core? If so is it on github?
sktyjd
@sktyjd
@SimonAntony did you have to make any changes to the codebase to get it to work with APSN?
SimonAntony
@SimonAntony
@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
@kiramishima
Hi, how can use .p8 certificate with PushSharp ?? anyone have a Example :D
(PushSharp.Core)
Adam J. Mendoza
@adammendoza
@SimonAntony Cool! does that mean that it works with dotnet core as is?
sourceship13
@sourceship13
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
moutabreath
@moutabreath
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
@SanSYS
Hi there! Are the project alive?
last commit at 1 Dec 2016
Unfortunately Redth/PushSharp#702 http/2 not supported yet =(
Joshua Russo
@rupe120
@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
CohenINT
@CohenINT
hello, i want to build an app that is get push notification question, how do i start?
Jek
@jekcom
Hi All. Seems like APNS does not support tls1.2, is that true?
baluleo
@baluleo
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
seecoolguy
@seecoolguy
To begin building a push notification app, try a tutorial like:
Ray Wenderlench
Ajay Kumar
@ajayetw2009_twitter
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.
Khilborn
@Khilborn
I downloaded this library. What do you need to actually send a push notification to a phone? Do I need a service? Where do I get "GCM-SENDER-ID" and "AUTH-TOKEN"? Just not really sure how to use it.
seecoolguy
@seecoolguy
Try the early tutorials: https://redth.codes/pushsharp-3-0-the-push-awakens/ on google things changed a bit with fire base but you have options of users subscribing to a feed like a basket ball score or personal notifications.
@ajayetw2009_twitter
Are your certs correct?
ericshiny
@ericshiny
guys, new to here. i want to ask one compatibility issue which i met on Mac OS 10.13
for 10.12 systems, the system notification can be displayed.
but for 10.13 systems, the system notification cannot be displayed.
i have checked the system preference setting in the OS.