1
votes

In order to setup unlimit device token expiry for old PNS subscription, I followed the forum and official blog post.

var namespaceManager = NamespaceManager.CreateFromConnectionString("Endpoint=sb://some-notification.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=Rfu98wpnj4gBo78tPWiI=");
NotificationHubDescription hub = namespaceManager.GetNotificationHub("push");
hub.RegistrationTtl = TimeSpan.MaxValue;
namespaceManager.UpdateNotificationHub(hub);

It gives below error;

ArgumentOutOfRangeException: Registration Ttl must be at most 90.00:00:00

Parameter name: value

Actual value was 10675199.02:48:05.4775807.

The classic portal still shows Registrations Time to Live: 90 days.

The Azure Notification Hubs nuget package version is 2.16.0.234 the newest. The blog post does not mention this result. How can I make it?

2

2 Answers

0
votes

Could you try with Notification Hub SDK from https://www.nuget.org/packages/Microsoft.Azure.NotificationHubs

Thanks,

Sateesh

0
votes

I guess that you're using the package Microsoft.ServiceBus

using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Notifications;

Let's install package "Microsoft.Azure.NotificationHubs" and replace the two lines above with

using Microsoft.Azure.NotificationHubs;

Then you can update RegistrationTtl for the notification hub.
Good luck!