dacastro4 / laravel-gmail

Laravel wrapper for the Gmail API
MIT License
292 stars 134 forks source link

setWatch() not working #246

Open ThomyLorenzatti opened 1 year ago

ThomyLorenzatti commented 1 year ago

Hello,

I am encountering an issue when trying to use the setWatch() function to get my Gmail messages in real-time. Everything is configured properly on the Google Cloud side and I have no errors, but I am not getting any response from the function as indicated in Google's documentation. On the Google Cloud side, nothing is happening. Here is my code for context:

$rq = new \Google_Service_Gmail_WatchRequest();
$rq->setLabelIds(['INBOX']);
$rq->setTopicName('projects/MY_PROJECT_NAME/topics/gmail');

$mailbox->setWatch('me', $rq);

Do you have any ideas to help me solve this issue? Thank you in advance.

uacode commented 1 year ago

Hello, can you try

$mailbox->setWatch('login@gmail.com', $rq);
ThomyLorenzatti commented 1 year ago

Hello, can you try

$mailbox->setWatch('login@gmail.com', $rq);

I have already try this and it's the same thing that use 'me' because the user is currently login with his gmail account

uacode commented 1 year ago

What in response? print_r($mailbox->setWatch('me', $rq));

umarzahid028 commented 3 weeks ago

Hey

Have you made any progress with real-time email retrieval? I want to implement a similar approach to fetch emails in real-time, rather than using a cron job.