Push notification not received - apple-push-notifications

We are connecting to 'gateway.push.apple.com 2195' from a c# console with a right device token and production certificate. Ssl authentication went fine and no issues reported but the device doesn't recieve any alert message or badge. Device is registered to recieve notifications. [Settings->Notifications is set to ON for badge, alert and sound]. We are using apns-sharp-1.0.3.0 c# source code. what else could go wrong and how to debug the issue.
P.S Note: One thing we noticed, the call back routine (OnAsyncRead.IsCompleted) hasn't been completed and we have to Dispose() it forcibly. Desperately looking out for a solution, anyone's feedback would be of great help. Thank you.

small time fix only - sleep the thread before closing and disposing - giving time for the APN to be sent.

Related

Microsoft Bot send the response twice in Teams

I've used Microsoft bot framework SDKv4, and integrated to Teams channel. It is running well, but giving responses twice.
But, I didn't get the same behavior, while I tested it on Emulator and Web Chat in Azure Portal.
However, I can see below issue, while I ping the bot in web chat and get a response.
Further, I can also see, that its always 'sending' as a status although I got a valid response, and the status later changes to "Send Failed. Retry"
Is the issue related to my teams integration for getting message twice? and how, should I fix it!
Are you using webhooks? If so, having multiple webhooks with same ID could be the reason for double messages. Hope this helps
I made my bot working. It was the issue of MS authentication!
I had a call with MS support person and the root cause appeared to be only the MS authentication. Had to reset app secret and then re-deloyment.
Its weird that, although it was not getting authenticated primarily yet it was returning me the response. This, I still haven't got it!

AJAX Request Error POST 0 () In Chrome Console Log

I occasionally got this error in chrome console log POST https://example.com/example 0 ()
There's no information at all about the error.
What it is mean?
How to see more information about the error and how to deal with it?
Thanks in advance
I am not sure what is this caused by. I am getting it sometimes too. But the error is gone when I reconnect to the internet.
EDIT:
This error is shown when there is no internet connection. For me the issue was that I was subscribing to the network connection and was doing call right on the event which was giving me mentioned error. I found out that this is too soon even if event on connected was already triggered and web app is not yet connected. Delay one second after the event solved this for me. My project is Angular Ionic android / iOS app.

Unclear error message on sending a notification to iOS

I'm trying to send a notification via C# SDK. I'm sending notifications for iOS.
string payload = "{\"aps\" : { \"alert\" : \"Message received from Bob\" }}";
var outcome = hub.SendAppleNativeNotificationAsync(payload, new[] { "b6a5d9c3-4297-422f-9a8d-b7979c30a5f8" }).GetAwaiter().GetResult();
Registration works fine, I can retrieve registered users, but I receive errors on sending. The error message is
Contract mismatch between ServiceBus and the Push Notification System
I've looked into manage.windowsazure.com for monitoring and saw that there were errors of type “Bad channel error”.
I assume that I should try to change my region for NH and probably the problem will go away, but is there anything else I could look at to resolve this issue?
Forgot to mention that everything was working on the first day I started to work with push notifications and only after several days became broken without any changes.
you may have open port 2135 and also add APN certificate
I didn't figured out what does that error mean but at least found the root cause. It was Testflight that by some obscure reasons uses production gateways to send notifications and not sandbox, and my NH has been configured with sandbox certificate, that's why it didn't work.

Debugging Google cloud messaging push messages

I am trying to send push messages to an android application.
The POST https://android.googleapis.com/gcm/send
seems to succeed and I get something (with some numbers changed) like:
{"multicast_id":9999063399994069899,
"success":1,
"failure":0,
"canonical_ids":0,
"results":[{"message_id":"0:1416520599679103%8d7d198de508343a"}]}
but I don't seem to get the notification on the device...
Is there anything that can be done with the message_id it track it forward ?
Can I somehow tell me if Google actually tired to deliver it to the device and what was the result of the attempt?
I know it's an old question and you might have solved it yourself by now, but for completeness I would like to post a solution here.
By now you can find the option GCM Diagnostics in your Google Play Developer Console when you have your app selected. It's placed on the left hand side.
You just post a registration token or a message id and will shortly see a summary of push notifications connected to this token/id, plus additional debug information.
Cheers!
well, at least until someone would provide a better answer about debugging based on message ids.
It turns out the problem in my case was that the phone gap plugin in I was using was expecting a "message" field in the push notification message payload.
A bug on my server side made this message not to exist so it was not displayed in the phones notification area...
my thanks to #Eran for partially pushing my towards the right line of thought.

Azure Notification Hub Register iOS Device Always Returns Unauthorized

Early on in developing an iOS app with Xamarin, another developer and I got push notifications working for it using the Azure Messaging Component. It's a few months later now, and sometime between then and now, the push notifications stopped working. The code is still basically the same as before (which is nearly identical to the example code for the component), it was just moved to its own class for maintainability.
On Hub.UnregisterAllAsync(DeviceToken, error =>, error is:
The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
On Hub.RegisterNativeAsync(DeviceToken, tags, error =>, error is:
URLRequest failed for <NSMutableURLRequest: 0x167dbd80>
{ URL: https://[our namespace].servicebus.windows.net/[our hub name]/Registrations/?$filter=deviceToken+eq+'[long token]'&api-version=2013-04 }
with status code: unauthorized
We tried a new hub, and a new namespace with a new hub, but without luck. I've rolled back the changes we've made since it was working, but with no luck there either. The same error happens on multiple devices, on multiple networks. It never shows any errors in the portal for APNS, so I'm assuming this is something with authenticating to the Hub itself. What is really weird is that a Windows Store app that we wrote to test this registers and receives notifications using the same credentials without any issue. Can anyone point me in the right direction on this? The error messages above aren't very helpful.
It turns out that the test devices all had the automatic date and time synchronization turned off. The iPad I was primarily testing with was only off by about 20 or 30 seconds, so I didn't notice it was off. Another question involving the same thing with a Windows or Windows Phone registration clued me into it, but I can't find the link to it now. Apologies for that, thanks to whoever that was!
Looking at the API, it makes sense why it's so sensitive to this. It uses the date and time to generate the SAS Token, thus the unauthorized response when the time is just a few seconds off.

Resources