Не получали уведомления от разработчиков в режиме реального времени

Я не получаю уведомления разработчиков в режиме реального времени из магазина Google Play. Я выполнил следующие шаги:

  1. Настройте GOOGLE_APPLICATION_CREDENTIALS.

  2. Настройте Listener для сообщений. Код получателя сообщения

    public List<ReceivedMessage> recieveAndroidNotification() throws IOException {
    
        String subscriptionId = "my-project-id";
        String projectId = "my-subscription-id";
        SubscriberStubSettings subscriberStubSettings = SubscriberStubSettings.newBuilder().build();
        try (SubscriberStub subscriber = GrpcSubscriberStub.create(subscriberStubSettings)) {
            // String projectId = "my-project-id";
            // String subscriptionId = "my-subscription-id";
            int numOfMessages = 10; // max number of messages to be pulled
            String subscriptionName = ProjectSubscriptionName.format(projectId, subscriptionId);
            PullRequest pullRequest = PullRequest.newBuilder().setMaxMessages(numOfMessages).setReturnImmediately(false) // return immediately if messages are not available
                    .setSubscription(subscriptionName).build();
    
            // use pullCallable().futureCall to asynchronously perform this operation
            PullResponse pullResponse = subscriber.pullCallable().call(pullRequest);
            List<String> ackIds = new ArrayList<>();
            for (ReceivedMessage message : pullResponse.getReceivedMessagesList()) {
                // handle received message
                // ...
                System.out.println("Message Recived");
                ackIds.add(message.getAckId());
            }
            // acknowledge received messages
            AcknowledgeRequest acknowledgeRequest = AcknowledgeRequest.newBuilder().setSubscription(subscriptionName).addAllAckIds(ackIds)
                    .build();
            // use acknowledgeCallable().futureCall to asynchronously perform this operation
            subscriber.acknowledgeCallable().call(acknowledgeRequest);
            return pullResponse.getReceivedMessagesList();
        }
    }
    
  3. Публикует тестовое уведомление в теме Cloud Pub/Sub, тем самым проверяя настройку и конфигурацию этой темы перед получением уведомлений в реальном времени. (уведомление не пришло)

  4. #P5# <блочная цитата> #P6#

Я что-то упускаю?


person Sandesh Dumbre    schedule 06.06.2018    source источник
comment
Возможный дубликат Как установить переменную среды GOOGLE_APPLICATION_CREDENTIALS?   -  person amport    schedule 11.06.2018