Parse and Heroku Service(2)Mail Templates and Push Notification
1 Sample Project for Parse Cloud
Parse Account Key
> parse configure accountkey
enter to open the key generate page.
The key is stored in local
> cat ~/.parse/netrc
machine api.parse.com#luohuazju@gmail.com
login default
password xxxxxxxxxxxxx
machine api.parse.com
login default
password xxxxxxxxxxxxx
Link Parse to Heroku
> parse new
existing —> Heroku
Following this document
https://www.parse.com/docs/cloudcode/guide#command-line
It will create an empty parse hello world project for us.
Project Structure
cloud/main.js will the place for cloud codes.
Deploy the cloud and public directories to Parse.com
> parse deploy
Then we can visit the static content here.
https://parsesample-3izxfd-1382.herokuapp.com/
2 Understand Some Codes
Define the function on the cloud
Parse.Cloud.define("hello", function(request, response) {
console.log('Ran cloud function.');
response.success("Hello world! " + (request.params.a + request.params.b));
});
Then we call functions from SDK(Android and iOS), PHP, .NET SDK, Javascript SDK, REST API
A lot of parse.com SDK command to debugging, logging and etc.
Command Line Tool with Heroku
…snip...
3 Read More Code Examples
Email Templates
We should Generate the Template Once, and Render the different users, orders, products times.
Email-templates from https://github.com/niftylettuce/node-email-templates
Cloud Code Request
Parse.Cloud.httpRequest({
method: 'POST',
url: url,
headers: {
'Content-Type': 'application/json',
'x-api-key': AMAZON_GATEWAY_KEY
},
body: JSON.stringify(data)
}).then(function(httpResponse) {
console.log(httpResponse.text);
var result = JSON.parse(httpResponse.text);
if (result['status'] === 'Fail') {
response.error('Request failed with message ' + httpResponse.text);
} else {
response.success(httpResponse.text);
}
}, function(httpResponse) {
console.error('Request failed with response code ' + httpResponse.status);
response.error('Request failed with response code ' + httpResponse.status);
});
Push Message
Parse.Push.send({
channels: ["global"],
data: {
alert: "We found a new job for you!"
}
});
AngularJS 1.4.9
Parse.com JS SDK 1.6.14 (Parse SDK provide SDK to deal with RestClients and a lot of .)
References:
http://sillycat.iteye.com/admin/blogs/2284695
https://www.parse.com/docs/cloudcode/guide#command-line
分享到:
相关推荐
Using Facebook’s Parse as backend service, and Adobe’s PhoneGap (or Cordova) as a mobile development framework, building a highly customizable application is easier than you can imagine. A basic ...
Using Facebook's Parse as backend service, and Adobe's PhoneGap (or Cordova) as a mobile development framework, building a highly customizable application is easier than you can imagine. A basic ...
NULL 博文链接:https://eric-gao.iteye.com/blog/1885557
前端开源库-parse5-htmlparser2-tree-adapterparse5-htmlparser2-tree-adapter,parse5的htmlparser2树适配器。
json2notification Contributors.. ...Convert JSON to Android Notification. This is very useful for push notification (GCM). ...Integration of Parse push notification public SimplePa
It is packed with step- by- step exercises, which will help you to take advantage of the real power of the Parse iOS cloud backend service, and provides you with an example- based approach to help ...
method and a parse method. The parse method uses the eval method to do the parsing, guarding it with several regular expressions to defend against accidental code execution hazards. On current ...
python parse and write excel
Build your applications using Parse iOS which serves as a complete cloud-based backend service Understand and write your code on cloud to minimize the load on the client side Learn how to create your ...
iOS eCommerce App Development with Parse uses a real-world app example to teach you how to build a complete eCommerce iPhone app powered by Parse—the most popular and powerful Platform as a Service ...
使不支持JSON.parse的浏览器,可以使用JSON.parse方法。 提供兼容性。
推送通知解析机器人使用 Parse 推送通知示例
刚开始解码H264视频时,查阅文档说有Nalu头,参考雷神代码,将文件指针传入去掉头可以解码,但是需要每次传入定量buffer解码,不是传入文件指针,经过修改可以用有bug
VERBOSE=1orVERBOSE_PARSE_SERVER_PUSH_ADAPTER=1这将为所有推送发送尝试产生更详细的输出在解析服务器上使用自定义版本安装推送适配器 npm install --save @parse/push-adapter@VERSION将 VERSION 替换为您要安装...
txt parse java file
This is a hands-on book which introduces you to agile JavaScript web and mobile software development using the latest cutting-edge front-end and back-end technologies including: Node.js,... Parse.com...
parse-push-plugin, 在分析平台上,为 Cordova/Phonegap/ionic 推送通知插件 Parse.Push 插件Cordova/Phonegap/ionic.的Parse.Push 插件,用于宿主 Parse.com 和开放源码解析服务器。高光工作在 Parse.com 和解析...
Produce, parse, and manipulate JSON data with the help of JSON-P API Cover best practices in building applications with WebSockets, ServerSentEvents, and JAX-RS 2.0 Learn the aspects of asynchronous ...
内容安装安装适配器: npm install --save parse-server-api-mail-adapter将添加到子目录。将添加到Parse Server。演示版演示脚本可以通过电子邮件服务提供商在不使用Parse Server的情况下发送电子邮件,从而轻松...
parse ok