Comments (3)
very strange.. the version 3.1.1 works well for me. It seems like it's a parsing error for when the response is received from the APN server. I wonder what it is.. Would be good to debug it. I'd be curious to see what you get in ApnSender in the line:
var content = await response.Content.ReadAsStringAsync();
from net-core-push-notifications.
Hey @andrei-m-code!
Okay I spent some time with it - you are right, it seems to fail when the error is parsed:
using (var response = await http.SendAsync(message, cancellationToken))
{
var succeed = response.IsSuccessStatusCode;
var content = await response.Content.ReadAsStringAsync();
var error = JsonHelper.Deserialize<ApnsError>(content); <-- Here
return new ApnsResponse
{
IsSuccess = succeed,
Error = error
};
}
The Content I got is the following:
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That’s an error.</ins>
<p>The requested URL <code>/3/device/C689B30554D56AAD13ED65D7D305C85235F79029233997D98484C0537F3183A6</code> was not found on this server. <ins>That’s all we know.</ins>
I did this several times and every time the same html came back with Google references (sending via Apple), also not sure why the html is not closed...but I am unsure what the format is supposed to be of these.
Does this point you in the right direction?
Thanks!
from net-core-push-notifications.
Hey @andrei-m-code!
I spent some more time on it and found the issue!
Basically, I have shared the same HttpClient instance with FcmSender and ApnSender which has worked fine up until 3.1.0.
But with 3.1.1 the HttpClient BaseAddress is now set within the FcmSender and ApnSender constructors once, while the previous version did that during sending every time (within the SendAsync function) - so that was it!
For anyone who has the same issue - simply use a separate HttpClient instance for FcmSender and ApnSender.
Thanks!
from net-core-push-notifications.
Related Issues (20)
- Push icon HOT 3
- Additional functionality HOT 1
- Non-hardcoded FCM Url HOT 3
- How can distinguish between fem tokens
- Distinguish between fcm tokens HOT 1
- Only HTTP/1.0 and HTTP/1.1 version requests are currently supported HOT 1
- ApnsResponse from ApnSender.Send has IsSuccess = true, but I never receive notification? HOT 1
- Cancel a notification HOT 1
- Support for System.Text.JSON HOT 5
- Migrate from legacy HTTP to HTTP v1 HOT 1
- ApnSender.Send throws an Exception when Bad DeviceId is provided. HOT 4
- Firebase Error Throws Exception HOT 2
- Usage clarification HOT 2
- For Anyone Who Has Issues with Azure Service & Firebase (Cryptography) - See this... HOT 1
- message.data serialization convention HOT 3
- Exception when sending notifications to iOS devices HOT 1
- work with apple wallet passbook HOT 1
- FirebaseSettings are a record thus not allowing binding to appsettings.json HOT 1
- Firebase CryptographicException when deployed to production server (NOT Azure)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from net-core-push-notifications.