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
Rob Maas
@robmaas
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
Michael Flynn
@cblaze22
Do I have to supply a device token even when sending to just a topic?
Michael Flynn
@cblaze22
I keep getting Unknown Failure: InvalidRegistration
gcmBroker.QueueNotification(new GcmNotification
{
To = $"topics/{topicId}",
Data = JObject.FromObject(new { message })
});
Michael Flynn
@cblaze22
I need a forward slash at the beginning.
Gurbir Singh
@logicerp1993_twitter
Hello , I want to use P8 file using PushSharp version 2.2.1.0
Can you please help me and server hosted on window azure .
ethanransdellasr
@ethanransdellasr
Hi there... PushSharp/Xamarin newbie here... Does anyone have experience with using PushSharp and Xamarin forms? I can't even get the PS package to install because of an error saying the package doesn't contain assembly references or content files compatible with monoandroid v6.0... Any ideas?
Dan
@dgritsko
Hey, quick question -- what's the recommended lifecycle duration for a ServiceBroker object?
E.g., should I create an instance per platform and keep them for as long as my process is around, or should I create them each time I need to send a push notification?