Null Reference Exception using Shiny.Extensions.Push to iOS #1453
Replies: 5 comments 1 reply
-
Generally - issues should go with their repos: https://github.com/shinyorg/apiservices I don't care if sponsors post stuff here though. For your issue, I will need the exact version you're using since this is a preview library. I'll also need the platform you're running on (windows, linux)? |
Beta Was this translation helpful? Give feedback.
-
Thanks, Allen – I saw the comment about preview, but wasn’t sure if that was preview or not. My apologies. Would you like me to delete the post and redo it in the correct spot?
I am on Windows 11 and debug the services locally in IE Express then publish an Linux App Service on Azure. I will push my text code to the Linux hosted service to see if the push completes there.
My ASP Net Core service is net 8 on web SDK
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
My ASP Net Core service is net 8 on web SDK
My class library that is called from a hosted service is also net 8 on net SDK:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
And the reference to the shiny push library is:
<PackageReference Include="Shiny.Extensions.Push" Version="1.1.0.60" />
Thanks, and let me know if helpful to move that post or if you prefer I leave at this point??
Best regards,
Victor
p.s. I cannot log into the sponsor connect, I suspect due to some issue with the git account thought – ever seen any issues with that or have ideas to troubleshoot it?
With my Vwilcox2000 personal that I accidentally loaded it up with the first time it loads, but with my actual sponsorship account ***@***.*** ***@***.***> , it shows:
Error.
An error occurred while processing your request.
Request ID: 00-d65df63581b333269b42d58cffafdcfe-2f3ca37862a783f7-00
Development Mode
Swapping to the Development environment displays detailed information about the error that occurred.
The Development environment shouldn't be enabled for deployed applications. It can result in displaying sensitive information from exceptions to end users. For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development and restarting the app.
From: Allan Ritchie ***@***.***>
Sent: Wednesday, April 17, 2024 9:34 AM
To: shinyorg/shiny ***@***.***>
Cc: Victor Thomas Wilcox, Jr., MD ***@***.***>; Author ***@***.***>
Subject: Re: [shinyorg/shiny] Null Reference Exception using Shiny.Extensions.Push to iOS (Discussion #1453)
Generally - issues should go with their repos: https://github.com/shinyorg/apiservices
I don't care if sponsors post stuff here though. For your issue, I will need the exact version you're using since this is a preview library. I'll also need the platform you're running on (windows, linux)?
—
Reply to this email directly, view it on GitHub <#1453 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/BH4BTBSNQMMWQANC34SM4ULY52B3VAVCNFSM6AAAAABGKKEOKOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TCNBTHE4DE> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/BH4BTBQHZAYR7NZDV6QZOZTY52B3VA5CNFSM6AAAAABGKKEOKOWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQARODK4.gif> Message ID: < ***@***.***> ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Here is fine. Github has you flagged as a sponsor, so I'm not concerned about having to ask for details. The issue templates just get the upfront stuff generally. In the case of your error, I'll have to test things on my end. The encryption to Apple requires specialized encryption. I'll have to get setup on my end with a linux box to ensure that's working. |
Beta Was this translation helpful? Give feedback.
-
Thank you! My test environment, to be clear is on my Windows using IIS Express, and if there is an issue with Linux, I can host this service responsible for notifications on a Windows App Server instance on IIS.
I appreciate your understanding, but I will try to use the most indicated posting spot next time.
Originally, a few months ago, I had push wired up in APNS on Azure for Google and iOS all working fine, then with FCM1 I had significant problems – it turns out I was using that tags wrong, but APNS stopped sending messages to my iOS device for some odd reason even with the content-available or being in foreground, etc., so I was ecstatic when I was able to get them working with Shiny.Extensions.Push – and it was working just fine sending test messages, but suddenly after I reorganized it into class libraries and a real world use case, THEN I get this error – so my suspicion has been that the AppleProvider is expecting some service, but that’s just a guess.
If this is not some simple item, we can certainly work with your paid support efforts – and/or use your contract services for a time to get it squared away – which we may do in the future regardless.
Regards,
Victor
From: Allan Ritchie ***@***.***>
Sent: Thursday, April 18, 2024 2:19 PM
To: shinyorg/shiny ***@***.***>
Cc: Victor Thomas Wilcox, Jr., MD ***@***.***>; Author ***@***.***>
Subject: Re: [shinyorg/shiny] Null Reference Exception using Shiny.Extensions.Push to iOS (Discussion #1453)
Would you like me to delete the post and redo it in the correct spot?
Here is fine. Github has you flagged as a sponsor, so I'm not concerned about having to ask for details. The issue templates just get the upfront stuff generally. In the case of your error, I'll have to test things on my end. The encryption to Apple requires specialized encryption. I'll have to get setup on my end with a linux box to ensure that's working.
—
Reply to this email directly, view it on GitHub <#1453 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/BH4BTBSLVQTSR7CIYP6RUPLY6AMDTAVCNFSM6AAAAABGKKEOKOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TCNJYHA3DA> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/BH4BTBR22IED26NW5AQGDDLY6AMDTA5CNFSM6AAAAABGKKEOKOWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQARPAMY.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
@aritchie Using latest preview version, I was able to see the code involved in the Pem Reading process. I did experiments, and the issue was I didn't know you had to leave the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- start and end tags on the key -- or else PemReader.ReadObject() returns null. That solved the null exception with protected ECDsa GetECDsa(string key). Thanks! |
Beta Was this translation helpful? Give feedback.
-
After originally having a working test application using the Shiny.Extensions.Push package, in my final aspnet.core web service meant for deployment, it is throwing an exception in the ApplePushProvider at the GetECDsa step. I suspect I may need to add package or register a service that I am missing. I would appreciate some guidance as my troubleshooting attempts have failed to identify the missing piece.
The registration of Apple and Google are currently being done directly:
I'm using tags and a repository out of sql server, but for now am directly testing with the device token as follows:
The notification is very simple with title, message, and one short set of key value pairs in the data.
Where as in my test setup, I was getting calls to OnNotificationSuccess, now they all go to OnNotificationError in my reporter with the following exception and stack trace in the exception:
Exception Description:
Object reference not set to an instance of an object.
Exception Stacktrace:
at Shiny.Extensions.Push.Infrastructure.ApplePushProvider.GetECDsa(String keyId)
at Shiny.Extensions.Push.Infrastructure.ApplePushProvider.CreateJwtToken(AppleConfiguration config)
at Shiny.Extensions.Push.Infrastructure.ApplePushProvider.GetJwtToken(AppleConfiguration config)
at Shiny.Extensions.Push.Infrastructure.ApplePushProvider.d__4.MoveNext()
at Shiny.Extensions.Push.Infrastructure.PushManager.d__16.MoveNext()
at Shiny.Extensions.Push.Infrastructure.PushManager.d__13.MoveNext()
I've double checked the keyId / key and compared the native device token to confirm they are correct. Any help as to what I'm might be missing or doing wrong is greatly appreciated.
This is my first post on the forum; though I've read the code of conduct if I have made a faux paus here -- or if more data is appropriate, please advice, thanks.
Beta Was this translation helpful? Give feedback.
All reactions