문제

I have a WP app that use NotificationHub.

To register the user, I call RegisterNativeAsync.

However, some users having slow connection raise to me that the loading is very long.

Is it possible to pass a CancellationToken when calling RegisterNativeAsync ?

Thanks,

도움이 되었습니까?

해결책

The method RegisterNativeAsync doesn't directly support a cancellation token itself but if you want to add a timeout you could do this by having another task which creates a timeout and using Task.WhenAny to simulate this.

As this is an awaitable method there should be no need for this to be causing any kind of delay for the user.
Perhaps you need to look at the UX around this call.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top