我正在尝试在我的应用中实现应用内订阅。因此,首先,我设置了实时通知。但是问题是我无法测试它们的应用内订阅。谁能帮我这个?让我描述一下我所拥有的。
当我按下“发送测试通知”按钮时,我可以成功接收请求,但是问题是请求没有任何值,如此处所述。
https://developer.android.com/google/play/billing/realtime_developer_notifications
根据链接,
Each publish made to a Pub/Sub topic contains a single base64-encoded DeveloperNotification with the following fields:
{
"version": string,
"packageName": string
"eventTimeMillis": long
"oneTimeProductNotification": OneTimeProductNotification
"subscriptionNotification": SubscriptionNotification
"testNotification": TestNotification
}
和
A TestNotification contains the following fields:
{
"version": string
}
所以我的问题是,如何测试这个Json?我的意思是为什么请求没有值?
谢谢。
最佳答案
对不起大家。
我发现了问题。
我试图以错误的方式获取字段。由于我的服务器技术是PHP,因此我试图从$ _POST数组中获取数据,但是正确的方法是
$result = file_get_contents("php://input");
关于android - 如何测试订阅的Google Play实时通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59716601/