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 08:32
    yurart commented #829
  • Dec 01 08:31
    yurart commented #829
  • Oct 08 05:11
    kikaragyozov commented #923
  • Oct 08 04:57
    kikaragyozov commented #923
  • Oct 08 04:57
    kikaragyozov commented #923
  • Oct 08 04:42
    kikaragyozov commented #923
  • Aug 25 18:15
    netwang commented #645
  • Aug 18 15:20
    nazarii-piontko closed #753
  • 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
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?
It seems like they are meant to be long-lived, but I don't see anything in the documentation that specifically references this.
Looks like I need to keep it around as long as possible
eric556
@eric556

I tried installing PushSharp using the NuGet package manager in visual studio but I keep getting the error:

Could not install package 'PushSharp 4.0.10'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Am I doing something wrong? This is my first time trying to install packages in Xamarin so I don't really know what I'm doing

Jonathan "J." Tower
@jonathantower

I'm getting the dreaded SSPI/badly-formatted error when I run my application from a fully-updated Windows Server 2012 R2 server, but it works fine in my development environment. I've made sure that the certificates (and private keys) are installed on the local computer, not just for the current user, and that they permissions for the private keys are shared with the appropriate users.

Here's the error message:
PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> PushSharp.Apple.ApnsConnectionException: SSL Stream Failed to Authenticate as Client ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted

Jonathan "J." Tower
@jonathantower
I've researched this for about a week and tried everything I could find on it, all to no avail. I'd appreciate any suggestions.
Jonathan "J." Tower
@jonathantower

Well, I figured it out...sort of. I'm not sure what certificate minutia is at play here, but I created the signing request in Windows 10, signed it via the Apple dev site, downloaded and installed the cert into Win10. Everything with PushSharp worked there, but when I exported the Cert/Private Key combination and imported that into Windows 2012 R2, the same code and certificate did NOT work. I wonder if Win2012 is somehow less capable with certificate algorithms.

I got it to work by creating the signing request on MacOS, exporting that to a P12, and importing the P12 into Windows 10 and Windows 2012.

minafaw
@minafaw
Hi all
I am new to Xamarin but I am come from mobile application background
when I have a deep look at pushSharp , I figure they using GCM in android and this deprecated why you dont shift to firebase as its the new one
isfo
@isfo
Hi can anyone help me?
Im receiving: "Your Certificate does not appear to be issued by Apple! Please check to ensure you have the correct certificate!" on pushsharp 2.x
isfo
@isfo
problem solved! changed "Apple Production IOS Push Services" by "Apple Push Services" in ApplePushChannelSettings.cs
virender-singh
@virender-singh
hi all
In case of android, I am using the sample code and OnNotificationSucceeded event is getting executed but not getting any notification
even though if I pass invalid token on that time also OnNotificationSucceeded event is getting executed
I am able to get notification in case of IOS
virender-singh
@virender-singh
hi anyone is there?
YoniH
@YoniH
Hi, how did you convert the p8 file (downloaded from Apple's dev portal) to pem or pfx/p12?
I'm trying to load the p8 file some how to x509certificate2
mikecoram
@mikecoram
Any chance someone familiar with WNS and PushSharp could take a look at this issue? Redth/PushSharp#720 StackOverflow Question