ie-web-notifications / ie-web-notifications.github.io

IE Web Notifications (desktop notifications)
http://ie-web-notifications.github.io/
8 stars 2 forks source link

No documentation is available #14

Open ambujkhanna opened 8 years ago

ambujkhanna commented 8 years ago

Hi,

I am trying to your plugin in my code for internet explorer but I am unable to use it due to lack of information. I didnt find any detailed/readme document where i can find steps to use it.

Can you please provide proper document for reference?

ie-web-notifications commented 8 years ago

Hi!

Actually your code needs to only obey the Notification API, I have mainly oriented on http://www.w3.org/TR/notifications/ and the supported functionality is listed on the main page under Additional notes. However there is one peculiarity, the addon creates Notification object in window object when it detects that the frame has been loaded or reloaded but it happens after firing of load event and its friends (which is common way to run javascript on finishing of the page loading). To avoid any kind of race conditions one need to have some mechanism to wait for window.Notification. One can find a simple version of it on the main page https://github.com/ukot/ie_web_notifications/blob/fc01b6d3603cd9a8225b9f61237ba516a15848ce/index.html#L474

Just in case, of course the addon should be installed and enabled on the user machine.

If you have any questions or something does not work please don't hesitate to contact me.

ambujkhanna commented 8 years ago

Thanks!! will check it out.

Can you please let me know another thing. When permission prompt for Allow or Deny and if user will click on denied then in future when he wants to allow it so how could user able to allow it?

ambujkhanna commented 8 years ago

In Internet Explorer I am unable to find option to allow earlier Denied permission.

I used this code to ask again for allow or block but Permission ask bar is not coming

 else if (Notification.permission === 'denied') {
                            Notification.requestPermission(function (permission) {
                              // If the user accepts, let's create a notification
                              if (permission === "granted") {
                                var notification = new Notification("Hi there!" + msgtxtNew);
                              }
                            });
                          }
ie-web-notifications commented 8 years ago

Can you please let me know another thing. When permission prompt for Allow or Deny and if user will click on denied then in future when he wants to allow it so how could user able to allow it?

In this case the user has to go to settings and give an access or remove the decision for particular web site. To get the settings dialog one can right click on a notification windwow (not for Toast) or run IE Web Notifications from start menu.

ambujkhanna commented 8 years ago

Hi,

Is it not possible to check if user permission is denied then we could ask again for permission?

Like code i have used. I am receiving alert but it;s not asking again for permission.

`if (Notification.permission === 'denied') {

   alert('Permission is Denied');

   Notification.requestPermission();

   Notification.requestPermission(function (permission) {

          Notification.requestPermission();

   });

}`

ie-web-notifications commented 8 years ago

Yes, it's deliberately not possible to show the permission prompting dialog again. Although that moment is not clearly explained in the specification all major browsers have such behaviour, so I have implemented it that way to stay consistent. I think it makes sense because otherwise the web site can be quite annoying by always asking for the permission.

ambujkhanna commented 8 years ago

Ya,agreed but sometimes it can work as per requirements.

But GREAT thanks for your plugin and your quick supports. Finally my issue solved and its working perfectly in IE.

I really appreciate your support. Thank You :+1:

ie-web-notifications commented 8 years ago

You are welcome.

Thanks a lot for the questions, I guess they can raise again, so I plan to go later through the conversation above, may be I put some important items on the web page or create some kind of tips for developers.