我正在尝试根据用户在我的应用中购买或订阅时来自Google的推送通知来更新数据库。为此,我将使用php。 将会发生什么:
我为pub子通知提供了URL,我需要解析数据,发出请求以获取更新的数据并相应地更新数据库。 我知道如何发出请求
$client = new \Google_Client();
$client->setAuthConfig('credentials.json');
$client->addScope('https://www.googleapis.com/auth/androidpublisher');
$service = new \Google_Service_AndroidPublisher($client);
$subscription = $service->purchases_subscriptions->get($package_name,
$product_id,
$token);
但是我不知道如何处理来自PubSub的订阅或购买并进行相应的处理。我该怎么办?