Skip to content

Make browser push available - #324

Open
Erik Zhang (erikzhang) wants to merge 1 commit into
Azure:mainfrom
erikzhang:BrowserPushSupport
Open

Make browser push available#324
Erik Zhang (erikzhang) wants to merge 1 commit into
Azure:mainfrom
erikzhang:BrowserPushSupport

Conversation

@erikzhang

@erikzhang Erik Zhang (erikzhang) commented Jun 16, 2024

Copy link
Copy Markdown

Things to consider before you submit the PR:

  • Are tests passing locally?
  • Are the files formatted correctly?
  • Did you add unit tests?
  • Did you test your change with either the sample apps that are included in the repository or with a blank app that uses your change?

Description

  1. Add DataContractSerializer for BrowserRegistrationDescription.
  2. Add BrowserRegistrationDescription as KnownType.
  3. Add params to BrowserNotification's constructor to support pushing direct notifications.

Related PRs or issues

Closes #305, closes #314

Misc

If anyone wants to preview the changes, this nuget package is available.

@erikzhang

Copy link
Copy Markdown
Author

Erik Zhang (@erikzhang) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@TuniDev-HUB

Copy link
Copy Markdown

not yet approved?

@AndrewTheWild

Copy link
Copy Markdown

Do you have a work example sending notification to browser?
With installing and method for sending?

@danielebanovaz

danielebanovaz commented Sep 21, 2024

Copy link
Copy Markdown

Is this supposed to work?
We're consistently getting this error:

Error: The JSON value could not be converted to Microsoft.NotificationHubs.Contracts.LegacyModels.BrowserPushSubscription. Path: $.pushChannel | LineNumber: 0 | BytePositionInLine: 487.. TrackingId:2c2348d4-64cb-4859-a6cc-93826077893b,TimeStamp:9/21/2024 2:10:21 PM +00:00\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode[] successfulResponseStatuses, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode successfulResponseStatus, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>c__DisplayClass91_0.<<CreateOrUpdateInstallationAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.RunOperation[T](Func``2 operation, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.RunOperation[T](Func``2 operation, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.CreateOrUpdateInstallationAsync(Installation installation, CancellationToken cancellationToken)\r\n

@msbuildnet

Copy link
Copy Markdown

Is this supposed to work? We're consistently getting this error:

Error: The JSON value could not be converted to Microsoft.NotificationHubs.Contracts.LegacyModels.BrowserPushSubscription. Path: $.pushChannel | LineNumber: 0 | BytePositionInLine: 487.. TrackingId:2c2348d4-64cb-4859-a6cc-93826077893b,TimeStamp:9/21/2024 2:10:21 PM +00:00\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode[] successfulResponseStatuses, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode successfulResponseStatus, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>c__DisplayClass91_0.<<CreateOrUpdateInstallationAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.RunOperation[T](Func2 operation, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.RunOperation[T](Func2 operation, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.CreateOrUpdateInstallationAsync(Installation installation, CancellationToken cancellationToken)\r\n

Same error on my side ...

Microsoft (@microsoft) : do your f*** job !

@danielebanovaz

Copy link
Copy Markdown

Is this supposed to work? We're consistently getting this error:
Error: The JSON value could not be converted to Microsoft.NotificationHubs.Contracts.LegacyModels.BrowserPushSubscription. Path: $.pushChannel | LineNumber: 0 | BytePositionInLine: 487.. TrackingId:2c2348d4-64cb-4859-a6cc-93826077893b,TimeStamp:9/21/2024 2:10:21 PM +00:00\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode[] successfulResponseStatuses, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.SendRequestAsync(HttpRequestMessage request, String trackingId, HttpStatusCode successfulResponseStatus, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.<>c__DisplayClass91_0.<<CreateOrUpdateInstallationAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.RunOperation[T](Func2 operation, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubRetryPolicy.RunOperation[T](Func2 operation, CancellationToken cancellationToken)\r\n at Microsoft.Azure.NotificationHubs.NotificationHubClient.CreateOrUpdateInstallationAsync(Installation installation, CancellationToken cancellationToken)\r\n

Same error on my side ...

Microsoft (@microsoft) : do your f*** job !

I posted a question on Stack Overflow and got an answer:

https://stackoverflow.com/q/79010204/1737091

I already gave up and wrote my own alternative to Notification Hubs, so I didn't try it, but maybe you can find it helpful!

@kwaclaw

Copy link
Copy Markdown

About "Error: The JSON value could not be converted to Microsoft.NotificationHubs.Contracts.LegacyModels.BrowserPushSubscription.":

This can be fixed by changing the type of PushChannel from string to object in Installation.cs and directly assign the BrowserPushSubscription to the PushChannel property in BrowserInstallation.cs.

See https://github.com/kwaclaw/azure-notificationhubs-dotnet

@bfenwick806

Copy link
Copy Markdown

Still no BrowserPush....API?

@painavin

Copy link
Copy Markdown

This is crazy. No support for browser push nofitication yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] Add support for Browser (Web Push) Why is the notification hub client missing BrowserNotification support?

8 participants