How can show advertisement in queue in sync with all users?
What I expected: I expected the advertisement to be displayed in real-time to the user, with the next advertisement in the queue being displayed once the current one is dismissed.
I also tried with useEffect to fetch data at one time and then make queue but its not real time
I haven't use prisma or postgres, cause I don't know can I use it or not ?
so I tried with pusher but not worked, if its works with prisma, I can implement that
https://stackoverflow.com/questions/78376205/how-can-displaying-real-time-advertisements-to-users-in-next-js-14-with-pusher-a
Stack Overflow
How can displaying real-time advertisements to users in Next.js 14 ...
I am trying to create a real-time advertisement queue for users in my Next.js 14 application, where each user sees one advertisement at a time, similar to Google Ads. I am using Pusher for real-tim...
2 Replies
What is the current behaviour that you are observing? Are you not getting advertisments in real time? Do you need to refresh the page to get new advvertisments?
currently I implemented client side code where data is fetch at once then I show them in interval of 2 minutes for each advertisement but its not real time, right ?
every user will see 1st advertisement when they open, casue that time it invokes the api at client side, so its not real time
I will share that code with you
with useEffect I can show ads but its not real time, I mean not sync 1 advertisement with all users