javascript class to request push notification permission + get the result