简体   繁体   English

在Firebase中执行PHP脚本?

[英]PHP script execution in Firebase?

Here's my scenario: I have 10 ios apps with subscription in app purchases. 这是我的情况:我有10个ios应用程序,在应用程序购买中有订阅。 I need one subscription purchase to be valid accross the 10 apps. 我需要购买一项订阅才能在10个应用中有效。 Thus I require server-side receipt validation. 因此,我需要服务器端收据验证。 The flow is like this: When the customer pays for the subscription, the receipt is sent to the Firebase DB and from there, I require a PHP script that takes in the receipt data . 流程是这样的:当客户支付订阅费用时,收据将发送到Firebase DB,然后从那里,我需要一个PHP脚本来接收收据数据。 as input and sends a 'POST' request to the App store. 作为输入,并将“ POST”请求发送到App Store。 The App store would then validate the receipt and return a JSON object back. 然后,App Store将验证收据并返回JSON对象。 We then overwrite the old receipt with the latest copy. 然后,我们用最新副本覆盖旧收据。 Also, whenever the user logs in to any of the apps, we repeat this process and update the receipt to make sure the subscription of the user is still valid. 另外,无论何时用户登录到任何应用程序,我们都会重复此过程并更新收据,以确保用户的订阅仍然有效。 My question is, is Firebase capable of dynamic script handling and HTTP requests? 我的问题是,Firebase能够进行动态脚本处理和HTTP请求吗?

Thanks :) for any help. 谢谢你的帮助。

Firebase Hosting cannot execute PHP scripts. Firebase托管无法执行PHP脚本。 It mostly a static hosting service (so serving uninterpreted HTML, JavaScript, CSS, etc). 它主要是静态托管服务(因此可以提供未解释的HTML,JavaScript,CSS等)。

Recently Firebase added the ability to connect Cloud Functions to Firebase Hosting . Firebase最近增加了将Cloud Functions连接到Firebase Hosting的功能 But that still doesn't allow you to run PHP code on Firebase Hosting. 但这仍然不允许您在Firebase Hosting上运行PHP代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM