Status of push notifications in browser

    • General

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Status of push notifications in browser

      Hi,
      apparently, Ogame supports notifications which may look similar to this (staged picture, not real): postimg.cc/image/6t3r4ryhj/

      However, I am unable to subscribe my account for notifications. The subscription link returns error "422 Unprocessable Entity".
      postimg.cc/image/kwukgi9sn/

      Does somebody have any information about this? Are notifications actually working, or is it an unfinished feature which does not work, yet, hence the error?
    • Are you just talking about the subscription subscribe action that returns a 422? There has not been any official communication about this, hence of course it is actually not working. What would that also be for a thing? Implementing a feature, and not communicating it? That wouldn't make any sense.

      By the way, just out of curiosity: How did you get the conclusion, that this is actually implementing notifications? Or, in other words: How did you get that request to fire? All I could find so far in this direction is the game/sw.js file, but this is not doing anything that is visible in your screenshots. Did you just make that up? :P
    • Well, I was just curious. My thought was, why would there be test code on live servers :)

      You can find the notification handler in the sw.js file, as you have already pointed out. The setup code is included in the big ogame javascript file. gf2.geo.gfsrv.net/cdn40/4d22ba5475e4b4b3d0b28adc7fea2a.js Search for "Push Notifications codelab".
      You can combine the code which is found there to show notifications by yourself, which I did for the screenshot. (execute in the ogame tab using the developer console)

      JavaScript Source Code

      1. navigator.serviceWorker.register('sw.js')
      2. .then(function (swReg) {
      3. console.log('Service Worker is registered', swReg);
      4. swReg.showNotification("This is only a test", {"body" : "I repeat, this is only a test.", "data" : {"link" : "redir.php?url=www.ogame.de"}});
      5. })
      6. .catch(function (error) {
      7. console.error('Service Worker Error', error);
      8. });

      The post was edited 1 time, last by Dark Sky ().

    • TGWo wrote:

      Could be that it was part of feed rss removed time ago ?
      No, almost certainly not.

      @Dark Sky Thanks for the short explanation. As already indicated before, Gameforge has not communicated anything related to the code you found. This obviously means this is either code for a feature yet to come, or a leftover from a feature which was planned, but never fully implemented. In both cases, it is only Gameforge's decision whether or not they are publishing or removing this code, as with any other things you can find in the sourcecode, e.g. comments in js/css files... ;) So, to sum it up: Nope, nobody can give you information about this, except maybe GF-employees, but I wouldn't necessarily expect an answer from them on this topic ;)