Giter Club home page Giter Club logo

Comments (5)

MisterBrownRSA avatar MisterBrownRSA commented on May 21, 2024

@Sageth Wouldn't this need to be done using sockets ? I'm curious, because otherwise you'd have to poll with AJAX...

from phparcade.

Sageth avatar Sageth commented on May 21, 2024

I haven't looked too deeply into it, other than cursory looks:
https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API
https://developers.google.com/web/fundamentals/push-notifications/display-a-notification

At a glance, this looks like it's an API call, but like I said, I haven't looked too deeply into it, so it may be much more involved than I initially thought.

from phparcade.

MisterBrownRSA avatar MisterBrownRSA commented on May 21, 2024

@Sageth Yes, this is only the type of notification that can be sent.

Typically when handling notifications it's either caller event based, eg. clicked on this button, show a notification.
or
It's socket event based where the back-end software will broadcast an event through something like pusher which the front end will be listening for - which then pushes the notification.

So what you're actually looking for here, is whether or not you're willing to have the user refresh the page in order to get the notification, or will the notification be pushed "real time". I'll run through the code and see if you aren't already using some sort of socket that I can just connect to.

from phparcade.

Sageth avatar Sageth commented on May 21, 2024

Thanks for the clarification. I had envisioned the event occurring during score submit process, which should only occur with those types of games. The score submission should occur here: https://github.com/Sageth/phparcade/blob/master/includes/classes/Scores.php#L53

This is an old codebase (PHP4, or possibly earlier) that I've spent a lot of time modernizing as part of my own learning, so I know the socket_ functions aren't used anywhere. I do appreciate the insight on this, though.

from phparcade.

Sageth avatar Sageth commented on May 21, 2024

I've since decided to use Discord for notifications due to the feature set. This was implemented in fb44d46 and have had a number of bug fixes to address some specific scenarios since implementation. Closing issue.

from phparcade.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.