From the course: Creating a DevOps Ecosystem for .NET MAUI Developers

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Consuming push notifications: General plumbing

Consuming push notifications: General plumbing - .NET MAUI Tutorial

From the course: Creating a DevOps Ecosystem for .NET MAUI Developers

Consuming push notifications: General plumbing

- [Instructor] We are going to continue working on the base class for registering devices with notification hubs. We really only have one more thing we have to do here. Implement the registered device with notification hub method. We want this class to return false if we are unable to register the device. So we're going to use a try catch block and if there's any exceptions, we're going to return false. So right inside here, we're going to get rid of the not implemented exception. And what we're going to do is we're going to go try and catch, and if there is an exception, we're just going to return false. Now if you're doing this and want better air handling, you might actually capture the exception and have some kind of return class where potentially, it not only has whether it was successful, but also if it wasn't successful, it might return like, an exception or some kind of status to tell why it was not successful. We also need this to be in a synchronous method and we'll put that…

Contents