这个代码snniped:
credential = GoogleWebAuthorizationBroker.AuthorizeAsync( GoogleClientSecrets.Load(stream).Secrets,//read from client secret.json file Scopes, "user", CancellationToken.None).Result; // Create Gmail API service. var service = new GmailService(new BaseClientService.Initializer() { HttpClientInitializer = credential, ApplicationName = ApplicationName, }); UsersResource.LabelsResource.ListRequest request = service.Users.Labels.List("me"); WatchRequest body = new WatchRequest() { TopicName = "projects/push-notifications-ver3/topics/mytopic", LabelIds = new[] {"INBOX"} string userId = "me"; UsersResource.WatchRequest watchRequest = service.Users.Watch(body, userId); WatchResponse test = watchRequest.Execute();
获取错误:将测试消息发送到Cloud PubSub项目/ push-notifications-ver3/topics/mytopic时出错:用户未被授权执行此操作.[403]
主题是通过订阅创建的,作为主题的所有者给予当前用户许可任何建议用户未授权的原因?