[英]how to execute php script in ios parse-server side?
my iOS swift app is deployed in heroku using Parse SDK, my question is how to execute php script in parse-server side when an action happend in ios app , eg: send confirmation email when new user signup using ios app by executing php script in the server side. 我的iOS swift应用程序是使用Parse SDK部署在heroku中的,我的问题是当ios应用程序中发生操作时,如何在解析服务器端执行php脚本,例如:通过在ios中执行php脚本使用ios应用程序注册新用户时发送确认电子邮件服务器端。
any idea ? 任何想法 ?
Thanks 谢谢
Parse server is based on NodeJS and not PHP. 解析服务器基于NodeJS而非PHP。 the only scripts that you can execute in parse-server should be written in NodeJS.
您可以在parse-server中执行的唯一脚本应使用NodeJS编写。 If you have some 3-party scripts written in PHP and those scripts are exposed in REST api you have 2 options:
如果您有一些用PHP编写的3方脚本,并且这些脚本在REST api中公开,则有2个选项:
[EDIT] in order to execute scripts when events occurs (eg user created, class updated etc) you can use cloud code triggers [EDIT]为了在事件发生时执行脚本(例如,用户创建,类更新等),您可以使用云代码触发器
for example a code that will be executed before a user is saved to the database is (from parse cloud code docs) : 例如,在将用户保存到数据库之前将执行的代码是(来自解析云代码文档):
Parse.Cloud.beforeSave(Parse.User, function(request, response) {
if (!request.object.get("email")) {
response.error("email is required for signup");
} else {
response.success();
}
});
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.