菜鸟教程小白 发表于 2022-12-11 18:41:39

ios - 从 Apple 服务器获取空白响应订阅状态 URL IAP、状态更新通知、状态更新通知


                                            <p><p>状态更新通知,statusUpdateNotification</p>

<p>我在 iTunes 帐户中的 APP 中设置订阅状态 URL,例如 <a href="https://www.xxxxxx.xx/iospushnotification.php" rel="noreferrer noopener nofollow">https://www.xxxxxx.xx/iospushnotification.php</a> </p>

<p>我也成功测试了 <strong>nscurl --ats-diagnostics <a href="https://www.xxxxxx.xx/iospushnotification.php" rel="noreferrer noopener nofollow">https://www.xxxxxx.xx/iospushnotification.php</a> </strong> </p>

<p>我还在 iospushnotification.php 文件中实现了 php 代码来获取 JSON 响应</p>

<p>我成功购买了自动续订订阅沙盒,但我没有收到任何状态更新通知我从苹果服务器到我的服务器收到空白 [] JSON 响应。</p>

<p> <a href="https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW6" rel="noreferrer noopener nofollow">https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Subscriptions.html#//apple_ref/doc/uid/TP40008267-CH7-SW6</a> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>如果有人在 2 年后仍然关心,我找到了一个解决方案,假设您使用的是 PHP。</p>

<p>来自 stackoverflow 帖子 <a href="https://stackoverflow.com/questions/18866571/receive-json-post-with-php" rel="noreferrer noopener nofollow">Receive JSON POST with PHP</a>我们需要这样做:</p>

<pre><code>$appleData = file_get_contents(&#39;php://input&#39;);
</code></pre>

<p>然后从那里 <code>try</code> 到 <code>json_decode($appleData)</code>。</p>

<p>(我以前从未做过如此奇怪的事情来获取 POST 数据,但我以前主要使用框架;不幸的是,我目前没有那种奢侈......)</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 从 Apple 服务器获取空白响应订阅状态 URL IAP、状态更新通知、状态更新通知,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/46218509/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/46218509/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 从 Apple 服务器获取空白响应订阅状态 URL IAP、状态更新通知、状态更新通知