Enable in-app notifications easily

Introduction

In-app notifications created a lot of hype on release day, but I still see that people struggle to set them up even with the step-by-step guide provided by Microsoft in the docs.

Since I hate repetitive tasks I created a simple Javascript snippet for one of my demos that will do everything for you with a simple copy & paste action in the dev tools console of your favorite browser. That way you can speed up enabling notifications in multiple apps with an almost one-click action.

Let’s explain how to do it!

Solution

First of all, navigate the browser to the model-driven app that does not have in-app notifications enabled.

Next, you need to open the dev tool which can be done via simple keyboard shortcuts – F12 and Ctrl+Shift+I or you can select the option from the browser settings by clicking on the three dots -> More tools -> Developer Tools.

Navigate to the Console tab and paste the snippet below to it.

You will see the loading screen that says Enabling in-app notifications… and after a few seconds if everything goes well you will have in-app notifications enabled for your app, otherwise, you will be presented with an error that you need to fix before running it again.

Now you should see the bell icon in the upper right corner of the screen if everything went well, if not, initiate Hard Reload (Ctrl + F5) just to be sure that you got the latest version of the app from the server.

It’s time to start spamming your users with all kinds of notifications!

Conclusion

This is nothing revolutionary, but I’m sure it can save you some time while enabling the notifications on multiple apps in multiple enviromments. I’m also sure that Microsoft will soon provide a user-friendly way to achieve this, but until that, you can simply copy & paste the snippet and wait for work to be done for you.