Commit 73d971bb authored by Martin Alvarez-Espinar's avatar Martin Alvarez-Espinar
Browse files

Update version of vuepress

parent 9f8b6407
......@@ -11,13 +11,13 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="preload" href="/developers/assets/css/0.styles.f297bc98.css" as="style"><link rel="preload" href="/developers/assets/js/app.714bc824.js" as="script"><link rel="preload" href="/developers/assets/js/47.064beef0.js" as="script"><link rel="prefetch" href="/developers/assets/js/10.2217dfff.js"><link rel="prefetch" href="/developers/assets/js/100.49588dcb.js"><link rel="prefetch" href="/developers/assets/js/101.dc72e809.js"><link rel="prefetch" href="/developers/assets/js/102.d91d7315.js"><link rel="prefetch" href="/developers/assets/js/103.21465b38.js"><link rel="prefetch" href="/developers/assets/js/104.6019d7b4.js"><link rel="prefetch" href="/developers/assets/js/105.8e859810.js"><link rel="prefetch" href="/developers/assets/js/106.7d3f24c4.js"><link rel="prefetch" href="/developers/assets/js/107.6d52516f.js"><link rel="prefetch" href="/developers/assets/js/108.20027388.js"><link rel="prefetch" href="/developers/assets/js/109.6dfe1339.js"><link rel="prefetch" href="/developers/assets/js/11.f4ff2abc.js"><link rel="prefetch" href="/developers/assets/js/110.05c3770d.js"><link rel="prefetch" href="/developers/assets/js/111.ce87c895.js"><link rel="prefetch" href="/developers/assets/js/112.79c5bef7.js"><link rel="prefetch" href="/developers/assets/js/113.0b9eb68e.js"><link rel="prefetch" href="/developers/assets/js/114.296e0e57.js"><link rel="prefetch" href="/developers/assets/js/115.56390ef1.js"><link rel="prefetch" href="/developers/assets/js/116.ff07963f.js"><link rel="prefetch" href="/developers/assets/js/117.c6dbbf68.js"><link rel="prefetch" href="/developers/assets/js/12.b1307b2e.js"><link rel="prefetch" href="/developers/assets/js/13.b65bbdc6.js"><link rel="prefetch" href="/developers/assets/js/14.fb2e9ac3.js"><link rel="prefetch" href="/developers/assets/js/15.e0c2e728.js"><link rel="prefetch" href="/developers/assets/js/16.56cc01cf.js"><link rel="prefetch" href="/developers/assets/js/17.283d6c27.js"><link rel="prefetch" href="/developers/assets/js/18.75560133.js"><link rel="prefetch" href="/developers/assets/js/19.0b6ce28c.js"><link rel="prefetch" href="/developers/assets/js/2.eab8c329.js"><link rel="prefetch" href="/developers/assets/js/20.29397315.js"><link rel="prefetch" href="/developers/assets/js/21.ef6a9e4f.js"><link rel="prefetch" href="/developers/assets/js/22.9e4784a9.js"><link rel="prefetch" href="/developers/assets/js/23.98a538da.js"><link rel="prefetch" href="/developers/assets/js/24.4ec156fa.js"><link rel="prefetch" href="/developers/assets/js/25.b8dad818.js"><link rel="prefetch" href="/developers/assets/js/26.9b088d9a.js"><link rel="prefetch" href="/developers/assets/js/27.6b02e132.js"><link rel="prefetch" href="/developers/assets/js/28.d8f163ee.js"><link rel="prefetch" href="/developers/assets/js/29.8474b56b.js"><link rel="prefetch" href="/developers/assets/js/3.e3e63969.js"><link rel="prefetch" href="/developers/assets/js/30.a6f9a561.js"><link rel="prefetch" href="/developers/assets/js/31.e3b95d87.js"><link rel="prefetch" href="/developers/assets/js/32.3cd6f7a6.js"><link rel="prefetch" href="/developers/assets/js/33.5f7ffe41.js"><link rel="prefetch" href="/developers/assets/js/34.9887c38b.js"><link rel="prefetch" href="/developers/assets/js/35.f6ea5d53.js"><link rel="prefetch" href="/developers/assets/js/36.094c3ae4.js"><link rel="prefetch" href="/developers/assets/js/37.3a57166c.js"><link rel="prefetch" href="/developers/assets/js/38.f562d1a3.js"><link rel="prefetch" href="/developers/assets/js/39.905582bb.js"><link rel="prefetch" href="/developers/assets/js/4.c4da023a.js"><link rel="prefetch" href="/developers/assets/js/40.ef84e1cf.js"><link rel="prefetch" href="/developers/assets/js/41.386b4e06.js"><link rel="prefetch" href="/developers/assets/js/42.f5a3a239.js"><link rel="prefetch" href="/developers/assets/js/43.9d1aaac3.js"><link rel="prefetch" href="/developers/assets/js/44.3599861d.js"><link rel="prefetch" href="/developers/assets/js/45.3bff5e93.js"><link rel="prefetch" href="/developers/assets/js/46.301afee9.js"><link rel="prefetch" href="/developers/assets/js/48.433c6ea1.js"><link rel="prefetch" href="/developers/assets/js/49.8bf296a9.js"><link rel="prefetch" href="/developers/assets/js/5.2df2cf91.js"><link rel="prefetch" href="/developers/assets/js/50.45d0724f.js"><link rel="prefetch" href="/developers/assets/js/51.7daa5932.js"><link rel="prefetch" href="/developers/assets/js/52.d9468dc0.js"><link rel="prefetch" href="/developers/assets/js/53.db9ea7b5.js"><link rel="prefetch" href="/developers/assets/js/54.9a0c867c.js"><link rel="prefetch" href="/developers/assets/js/55.89eb80e6.js"><link rel="prefetch" href="/developers/assets/js/56.bb8d27ad.js"><link rel="prefetch" href="/developers/assets/js/57.a6125e3f.js"><link rel="prefetch" href="/developers/assets/js/58.ca0d9e6e.js"><link rel="prefetch" href="/developers/assets/js/59.8f0ce8f3.js"><link rel="prefetch" href="/developers/assets/js/6.cfccf0fa.js"><link rel="prefetch" href="/developers/assets/js/60.8c6cad21.js"><link rel="prefetch" href="/developers/assets/js/61.c4f1aeef.js"><link rel="prefetch" href="/developers/assets/js/62.209331ff.js"><link rel="prefetch" href="/developers/assets/js/63.0910e2a6.js"><link rel="prefetch" href="/developers/assets/js/64.8672f339.js"><link rel="prefetch" href="/developers/assets/js/65.5b96c43d.js"><link rel="prefetch" href="/developers/assets/js/66.19325481.js"><link rel="prefetch" href="/developers/assets/js/67.e9390fe3.js"><link rel="prefetch" href="/developers/assets/js/68.ef1b7965.js"><link rel="prefetch" href="/developers/assets/js/69.68b19069.js"><link rel="prefetch" href="/developers/assets/js/7.dd2f7a4e.js"><link rel="prefetch" href="/developers/assets/js/70.a35c12c6.js"><link rel="prefetch" href="/developers/assets/js/71.519ed814.js"><link rel="prefetch" href="/developers/assets/js/72.310f4bb6.js"><link rel="prefetch" href="/developers/assets/js/73.aa1afb73.js"><link rel="prefetch" href="/developers/assets/js/74.73d9b33e.js"><link rel="prefetch" href="/developers/assets/js/75.28cc1136.js"><link rel="prefetch" href="/developers/assets/js/76.22e106e5.js"><link rel="prefetch" href="/developers/assets/js/77.8a276dce.js"><link rel="prefetch" href="/developers/assets/js/78.189bcf48.js"><link rel="prefetch" href="/developers/assets/js/79.d5f1205a.js"><link rel="prefetch" href="/developers/assets/js/8.1e7255e1.js"><link rel="prefetch" href="/developers/assets/js/80.ed673e86.js"><link rel="prefetch" href="/developers/assets/js/81.331c66ce.js"><link rel="prefetch" href="/developers/assets/js/82.9c60da69.js"><link rel="prefetch" href="/developers/assets/js/83.3121d6c4.js"><link rel="prefetch" href="/developers/assets/js/84.c0e31790.js"><link rel="prefetch" href="/developers/assets/js/85.79e3034e.js"><link rel="prefetch" href="/developers/assets/js/86.00af365c.js"><link rel="prefetch" href="/developers/assets/js/87.ed1f0f86.js"><link rel="prefetch" href="/developers/assets/js/88.3326ea9d.js"><link rel="prefetch" href="/developers/assets/js/89.64950b09.js"><link rel="prefetch" href="/developers/assets/js/9.f7b0678e.js"><link rel="prefetch" href="/developers/assets/js/90.e8e9c441.js"><link rel="prefetch" href="/developers/assets/js/91.6d504866.js"><link rel="prefetch" href="/developers/assets/js/92.cd7c0855.js"><link rel="prefetch" href="/developers/assets/js/93.7686817e.js"><link rel="prefetch" href="/developers/assets/js/94.bf1c066d.js"><link rel="prefetch" href="/developers/assets/js/95.b3bbb073.js"><link rel="prefetch" href="/developers/assets/js/96.2e68739d.js"><link rel="prefetch" href="/developers/assets/js/97.63e46e1f.js"><link rel="prefetch" href="/developers/assets/js/98.303583df.js"><link rel="prefetch" href="/developers/assets/js/99.6a9dee05.js">
<link rel="preload" href="/developers/assets/css/0.styles.f297bc98.css" as="style"><link rel="preload" href="/developers/assets/js/app.086d6ac4.js" as="script"><link rel="preload" href="/developers/assets/js/47.064beef0.js" as="script"><link rel="prefetch" href="/developers/assets/js/10.94ba081c.js"><link rel="prefetch" href="/developers/assets/js/100.3348a6fe.js"><link rel="prefetch" href="/developers/assets/js/101.caa66796.js"><link rel="prefetch" href="/developers/assets/js/102.6f5a229f.js"><link rel="prefetch" href="/developers/assets/js/103.44a03898.js"><link rel="prefetch" href="/developers/assets/js/104.29841e42.js"><link rel="prefetch" href="/developers/assets/js/105.783a7973.js"><link rel="prefetch" href="/developers/assets/js/106.0df29714.js"><link rel="prefetch" href="/developers/assets/js/107.2f9add53.js"><link rel="prefetch" href="/developers/assets/js/108.7a211017.js"><link rel="prefetch" href="/developers/assets/js/109.1045e8a6.js"><link rel="prefetch" href="/developers/assets/js/11.4217f03a.js"><link rel="prefetch" href="/developers/assets/js/110.d29ad944.js"><link rel="prefetch" href="/developers/assets/js/111.09ec7244.js"><link rel="prefetch" href="/developers/assets/js/112.e167d7d3.js"><link rel="prefetch" href="/developers/assets/js/113.41196fad.js"><link rel="prefetch" href="/developers/assets/js/114.4e0373d0.js"><link rel="prefetch" href="/developers/assets/js/12.ff2c0500.js"><link rel="prefetch" href="/developers/assets/js/13.44f47204.js"><link rel="prefetch" href="/developers/assets/js/14.c10f2aee.js"><link rel="prefetch" href="/developers/assets/js/15.60f75ecf.js"><link rel="prefetch" href="/developers/assets/js/16.8619362b.js"><link rel="prefetch" href="/developers/assets/js/17.c3356807.js"><link rel="prefetch" href="/developers/assets/js/18.d13f6ede.js"><link rel="prefetch" href="/developers/assets/js/19.0b6ce28c.js"><link rel="prefetch" href="/developers/assets/js/2.eab8c329.js"><link rel="prefetch" href="/developers/assets/js/20.d8811605.js"><link rel="prefetch" href="/developers/assets/js/21.1f80d5ab.js"><link rel="prefetch" href="/developers/assets/js/22.b56dffbb.js"><link rel="prefetch" href="/developers/assets/js/23.30e78fcd.js"><link rel="prefetch" href="/developers/assets/js/24.dc05ca21.js"><link rel="prefetch" href="/developers/assets/js/25.b45b0c0f.js"><link rel="prefetch" href="/developers/assets/js/26.f5b22883.js"><link rel="prefetch" href="/developers/assets/js/27.fba363b1.js"><link rel="prefetch" href="/developers/assets/js/28.d8f163ee.js"><link rel="prefetch" href="/developers/assets/js/29.2b3a1594.js"><link rel="prefetch" href="/developers/assets/js/3.e78b340b.js"><link rel="prefetch" href="/developers/assets/js/30.f7643165.js"><link rel="prefetch" href="/developers/assets/js/31.e3b95d87.js"><link rel="prefetch" href="/developers/assets/js/32.07698818.js"><link rel="prefetch" href="/developers/assets/js/33.5f7ffe41.js"><link rel="prefetch" href="/developers/assets/js/34.9887c38b.js"><link rel="prefetch" href="/developers/assets/js/35.edfce33a.js"><link rel="prefetch" href="/developers/assets/js/36.9ba96895.js"><link rel="prefetch" href="/developers/assets/js/37.b0b832a7.js"><link rel="prefetch" href="/developers/assets/js/38.39e3c29d.js"><link rel="prefetch" href="/developers/assets/js/39.a2521797.js"><link rel="prefetch" href="/developers/assets/js/4.5fcdf742.js"><link rel="prefetch" href="/developers/assets/js/40.8f9104bf.js"><link rel="prefetch" href="/developers/assets/js/41.1354457c.js"><link rel="prefetch" href="/developers/assets/js/42.9315f0f5.js"><link rel="prefetch" href="/developers/assets/js/43.0d349375.js"><link rel="prefetch" href="/developers/assets/js/44.3599861d.js"><link rel="prefetch" href="/developers/assets/js/45.d2ca0861.js"><link rel="prefetch" href="/developers/assets/js/46.301afee9.js"><link rel="prefetch" href="/developers/assets/js/48.a21139ed.js"><link rel="prefetch" href="/developers/assets/js/49.655b7572.js"><link rel="prefetch" href="/developers/assets/js/5.8e52a4df.js"><link rel="prefetch" href="/developers/assets/js/50.9604ace3.js"><link rel="prefetch" href="/developers/assets/js/51.3b47032e.js"><link rel="prefetch" href="/developers/assets/js/52.7c24c9cc.js"><link rel="prefetch" href="/developers/assets/js/53.93a267b1.js"><link rel="prefetch" href="/developers/assets/js/54.7d91a828.js"><link rel="prefetch" href="/developers/assets/js/55.df7fec86.js"><link rel="prefetch" href="/developers/assets/js/56.6595b91c.js"><link rel="prefetch" href="/developers/assets/js/57.44f4717d.js"><link rel="prefetch" href="/developers/assets/js/58.0dfb087f.js"><link rel="prefetch" href="/developers/assets/js/59.2226a98c.js"><link rel="prefetch" href="/developers/assets/js/6.cfccf0fa.js"><link rel="prefetch" href="/developers/assets/js/60.9e23cdab.js"><link rel="prefetch" href="/developers/assets/js/61.59e96566.js"><link rel="prefetch" href="/developers/assets/js/62.209331ff.js"><link rel="prefetch" href="/developers/assets/js/63.73f8530d.js"><link rel="prefetch" href="/developers/assets/js/64.8672f339.js"><link rel="prefetch" href="/developers/assets/js/65.c3ac76d8.js"><link rel="prefetch" href="/developers/assets/js/66.94bcc911.js"><link rel="prefetch" href="/developers/assets/js/67.430ae45b.js"><link rel="prefetch" href="/developers/assets/js/68.ad002e22.js"><link rel="prefetch" href="/developers/assets/js/69.e79d80f5.js"><link rel="prefetch" href="/developers/assets/js/7.dd2f7a4e.js"><link rel="prefetch" href="/developers/assets/js/70.dddf68b4.js"><link rel="prefetch" href="/developers/assets/js/71.8654b4e9.js"><link rel="prefetch" href="/developers/assets/js/72.446e175e.js"><link rel="prefetch" href="/developers/assets/js/73.c9cfeb37.js"><link rel="prefetch" href="/developers/assets/js/74.867de1de.js"><link rel="prefetch" href="/developers/assets/js/75.02e553c2.js"><link rel="prefetch" href="/developers/assets/js/76.e2683c99.js"><link rel="prefetch" href="/developers/assets/js/77.81eee20f.js"><link rel="prefetch" href="/developers/assets/js/78.cb88264c.js"><link rel="prefetch" href="/developers/assets/js/79.4e732b5c.js"><link rel="prefetch" href="/developers/assets/js/8.3456d1c6.js"><link rel="prefetch" href="/developers/assets/js/80.6a387864.js"><link rel="prefetch" href="/developers/assets/js/81.ae33c8a3.js"><link rel="prefetch" href="/developers/assets/js/82.e01783f9.js"><link rel="prefetch" href="/developers/assets/js/83.95e00435.js"><link rel="prefetch" href="/developers/assets/js/84.d0ffae11.js"><link rel="prefetch" href="/developers/assets/js/85.c23906ba.js"><link rel="prefetch" href="/developers/assets/js/86.5c59a63d.js"><link rel="prefetch" href="/developers/assets/js/87.8d60804f.js"><link rel="prefetch" href="/developers/assets/js/88.e63ff142.js"><link rel="prefetch" href="/developers/assets/js/89.3409ca85.js"><link rel="prefetch" href="/developers/assets/js/9.62fa1c22.js"><link rel="prefetch" href="/developers/assets/js/90.2c68cbd9.js"><link rel="prefetch" href="/developers/assets/js/91.e200c936.js"><link rel="prefetch" href="/developers/assets/js/92.2b8d776f.js"><link rel="prefetch" href="/developers/assets/js/93.f1f07cd2.js"><link rel="prefetch" href="/developers/assets/js/94.91251858.js"><link rel="prefetch" href="/developers/assets/js/95.0bef4663.js"><link rel="prefetch" href="/developers/assets/js/96.9a576f57.js"><link rel="prefetch" href="/developers/assets/js/97.6afcc17f.js"><link rel="prefetch" href="/developers/assets/js/98.0c9eb8c2.js"><link rel="prefetch" href="/developers/assets/js/99.95f922ad.js">
<link rel="stylesheet" href="/developers/assets/css/0.styles.f297bc98.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="theme-default-content"><h1>404</h1> <blockquote>Looks like we've got some broken links.</blockquote> <a href="/developers/" class="router-link-active">
<div id="app" data-server-rendered="true"><div class="theme-container"><div class="theme-default-content"><h1>404</h1> <blockquote>How did we get here?</blockquote> <a href="/developers/" class="router-link-active">
Take me home.
</a></div></div><div class="global-ui"><!----></div></div>
<script src="/developers/assets/js/app.714bc824.js" defer></script><script src="/developers/assets/js/47.064beef0.js" defer></script>
<script src="/developers/assets/js/app.086d6ac4.js" defer></script><script src="/developers/assets/js/47.064beef0.js" defer></script>
</body>
</html>
(window.webpackJsonp=window.webpackJsonp||[]).push([[100],{526:function(t,a,s){"use strict";s.r(a);var e=s(28),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"audio-recording"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#audio-recording"}},[t._v("#")]),t._v(" Audio Recording")]),t._v(" "),s("p",[s("strong",[t._v("Audio recording functions.")])]),t._v(" "),s("h2",{attrs:{id:"manifest-declaration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),s("p",[t._v("You need to declare the use of this API in the "),s("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),s("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.record"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"module-import"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),s("p",[t._v("Before using this service in a component, you need to "),s("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),s("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" record "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.record'")]),t._v(" \n")])])]),s("p",[t._v("Or")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" record "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.record"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),s("p",[t._v("This service has the following methods:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"#start-duration-samplerate-numberofchannels-encodebitrate-format-success-fail-complete"}},[s("code",[t._v("start({duration,sampleRate,numberOfChannels,encodeBitRate,format,success,fail,complete})")])])]),t._v(" "),s("li",[s("a",{attrs:{href:"#stop"}},[s("code",[t._v("stop()")])])])]),t._v(" "),s("h3",{attrs:{id:"start-duration-samplerate-numberofchannels-encodebitrate-format-success-fail-complete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#start-duration-samplerate-numberofchannels-encodebitrate-format-success-fail-complete"}},[t._v("#")]),t._v(" "),s("code",[t._v("start({duration,sampleRate,numberOfChannels,encodeBitRate,format,success,fail,complete})")])]),t._v(" "),s("p",[s("strong",[t._v("Start a recording")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),s("p",[t._v("This method requires an "),s("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("duration")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute indicating the duration of the recording, in milliseconds. The value by default is "),s("code",[t._v("-1")]),t._v(".")]),t._v(" "),s("li",[s("code",[t._v("sampleRate")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the sampling rate. The options are: "),s("code",[t._v("8000")]),t._v(", "),s("code",[t._v("16000")]),t._v(", and "),s("code",[t._v("44100")]),t._v(".")]),t._v(" "),s("li",[s("code",[t._v("numberOfChannels")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the number of recording channels. The options are "),s("code",[t._v("1")]),t._v(" (mono) and "),s("code",[t._v("2")]),t._v(" (stereo).")]),t._v(" "),s("li",[s("code",[t._v("encodeBitRate")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the encoding bit rate.")]),t._v(" "),s("li",[s("code",[t._v("format")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Optional attribute specifying the audio format. The options are "),s("code",[t._v("3gpp")]),t._v(", "),s("code",[t._v("amr")]),t._v(", and "),s("code",[t._v("aac")]),t._v(". The default value is "),s("code",[t._v("3gpp")]),t._v(".")]),t._v(" "),s("li",[s("code",[t._v("success")]),t._v("\t("),s("code",[t._v("function(object)")]),t._v("). Optional callback function for success. The function has an "),s("code",[t._v("object")]),t._v(" argument with the following attributes:\n"),s("ul",[s("li",[s("code",[t._v("uri")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Path for storing the recordings, which is in the cache of the app. Recording files are in 3GPP format.")])])]),t._v(" "),s("li",[s("code",[t._v("fail")]),t._v(" ("),s("code",[t._v("function(data, code)")]),t._v("). Optional callback function for failure. The method can produce the following code:\n"),s("ul",[s("li",[s("code",[t._v("201")]),t._v(" when the user rejected the request for the recording permission.")])])]),t._v(" "),s("li",[s("code",[t._v("complete")]),t._v(" ("),s("code",[t._v("function()")]),t._v("). Optional callback function for completion.")])]),t._v(" "),s("div",{staticClass:"custom-block tip"},[s("p",{staticClass:"custom-block-title"},[t._v("AAC Sampling Rates")]),t._v(" "),s("p",[t._v("If the format is set to "),s("code",[t._v("aac")]),t._v(", the mapping between sampling rates and bit rates is described as follows:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Sampling Rate")]),t._v(" "),s("th",[t._v("Bit Rate")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("8000")]),t._v(" "),s("td",[t._v("16000-48000")])]),t._v(" "),s("tr",[s("td",[t._v("11025")]),t._v(" "),s("td",[t._v("16000-48000")])]),t._v(" "),s("tr",[s("td",[t._v("12000")]),t._v(" "),s("td",[t._v("24000-64000")])]),t._v(" "),s("tr",[s("td",[t._v("16000")]),t._v(" "),s("td",[t._v("24000-64000")])]),t._v(" "),s("tr",[s("td",[t._v("22050")]),t._v(" "),s("td",[t._v("32000-128000")])]),t._v(" "),s("tr",[s("td",[t._v("24000")]),t._v(" "),s("td",[t._v("32000-128000")])]),t._v(" "),s("tr",[s("td",[t._v("32000")]),t._v(" "),s("td",[t._v("48000-192000")])]),t._v(" "),s("tr",[s("td",[t._v("44100")]),t._v(" "),s("td",[t._v("64000-320000")])]),t._v(" "),s("tr",[s("td",[t._v("48000")]),t._v(" "),s("td",[t._v("64000-320000")])])])])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("record"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("start")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n duration"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n sampleRate"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n numberOfChannels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n encodeBitRate"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n format"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'aac'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("ret")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Storing at '")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" ret"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("uri"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("erromsg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" errocode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'record.startRecord: '")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" errocode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("': '")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" erromsg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("complete")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'record.startRecord complete'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"stop"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#stop"}},[t._v("#")]),t._v(" "),s("code",[t._v("stop()")])]),t._v(" "),s("p",[s("strong",[t._v("Stop a recording")]),t._v(".")]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("record"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stop")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{530:function(t,a,s){"use strict";s.r(a);var e=s(28),n=Object(e.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"sharing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sharing"}},[t._v("#")]),t._v(" Sharing")]),t._v(" "),s("p",[s("strong",[t._v("Data sharing with other apps")]),t._v(".")]),t._v(" "),s("h2",{attrs:{id:"manifest-declaration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),s("p",[t._v("You need to declare the use of this API in the "),s("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),s("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.share"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"module-import"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),s("p",[t._v("Before using this service in a component, you need to "),s("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),s("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" share "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.share'")]),t._v(" \n")])])]),s("p",[t._v("Or")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" share "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.share"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),s("p",[t._v("This service has the following method:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"#share-type-data-success-fail-cancel-complete"}},[s("code",[t._v("share({type,data,success,fail,cancel,complete})")])])])]),t._v(" "),s("h3",{attrs:{id:"share-type-data-success-fail-cancel-complete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#share-type-data-success-fail-cancel-complete"}},[t._v("#")]),t._v(" "),s("code",[t._v("share({type,data,success,fail,cancel,complete})")])]),t._v(" "),s("p",[s("strong",[t._v("This method enables the app to share data with other apps.")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),s("p",[t._v("This method requires an "),s("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("type")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Mandatory "),s("code",[t._v("string")]),t._v(" with the MIME type of the data to share (lowercase).")]),t._v(" "),s("li",[s("code",[t._v("data")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Mandatory "),s("code",[t._v("string")]),t._v(" with the data to share. The value can be of different types:\n"),s("ul",[s("li",[t._v("If the value of "),s("code",[t._v("type")]),t._v(" is a MIME type starting by "),s("code",[t._v("text/")]),t._v(" (e.g.,, "),s("code",[t._v("text/plain")]),t._v("), "),s("code",[t._v("data")]),t._v(" contains the textual content to share.")]),t._v(" "),s("li",[t._v("Otherwise, "),s("code",[t._v("data")]),t._v(" must contain the path of the file to be shared. The following file paths are supported:\n"),s("ul",[s("li",[t._v("Path of the file downloaded through "),s("RouterLink",{attrs:{to:"/services/fetch.html#fetch"}},[s("code",[t._v("fetch.fetch()")])]),t._v(";")],1),t._v(" "),s("li",[t._v("File path obtained through "),s("RouterLink",{attrs:{to:"/services/file-storage.html#save"}},[s("code",[t._v("file.save()")])]),t._v(" or "),s("RouterLink",{attrs:{to:"/services/file-storage.html#list"}},[s("code",[t._v("file.list()")])])],1),t._v(" "),s("li",[t._v("In-app resource file path starting with a slash character ("),s("code",[t._v("/")]),t._v(").")])])])])]),t._v(" "),s("li",[s("code",[t._v("success")]),t._v("\t("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the successful execution.")]),t._v(" "),s("li",[s("code",[t._v("fail")]),t._v(" ("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the failed execution.")]),t._v(" "),s("li",[s("code",[t._v("cancel")]),t._v(" ("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the cancellation of the execution.")]),t._v(" "),s("li",[s("code",[t._v("complete")]),t._v(" ("),s("code",[t._v("function")]),t._v("). Optional callback function corresponding to the end of the execution.")])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("share"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("share")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/html"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n data"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<b>bold</b>"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling success"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling fail, code="')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" code"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{531:function(t,s,a){"use strict";a.r(s);var e=a(28),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"sms-messages"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sms-messages"}},[t._v("#")]),t._v(" SMS Messages")]),t._v(" "),a("p",[a("strong",[t._v("SMS (texts) distribution.")])]),t._v(" "),a("h2",{attrs:{id:"manifest-declaration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),a("p",[t._v("You need to declare the use of this API in the "),a("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),a("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.sms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"module-import"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),a("p",[t._v("Before using this service in a component, you need to "),a("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),a("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sms "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.sms'")]),t._v(" \n")])])]),a("p",[t._v("Or")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" sms "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.sms"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),a("h2",{attrs:{id:"methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),a("p",[t._v("This service has the following method:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"#send-address-content-success-fail-complete"}},[a("code",[t._v("send({address,content,success,fail,complete})")])])])]),t._v(" "),a("h3",{attrs:{id:"send-address-content-success-fail-complete"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#send-address-content-success-fail-complete"}},[t._v("#")]),t._v(" "),a("code",[t._v("send({address,content,success,fail,complete})")])]),t._v(" "),a("p",[a("strong",[t._v("Sends SMS messages")]),t._v(".")]),t._v(" "),a("p",[t._v("Every time this method is called, the system will show a confirmation prompt. SMS messages contains up to 70 characters.")]),t._v(" "),a("h4",{attrs:{id:"arguments"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),a("p",[t._v("This method requires an "),a("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("address")]),t._v(" ("),a("code",[t._v("string")]),t._v("). Mandatory attribute with the destination phone number to which the SMS message will be sent. (The value may start with a plus character ("),a("code",[t._v("+")]),t._v(") and may contain numeric characters and spaces.)")]),t._v(" "),a("li",[a("code",[t._v("success")]),t._v("\t("),a("code",[t._v("function()")]),t._v("). Optional callback function for success.")]),t._v(" "),a("li",[a("code",[t._v("fail")]),t._v(" ("),a("code",[t._v("function(data, code)")]),t._v("). Optional callback function for failure. Some of the codes that can be produced:\n"),a("ul",[a("li",[a("code",[t._v("200")]),t._v(": Sending failed.")]),t._v(" "),a("li",[a("code",[t._v("201")]),t._v(": The user has rejected the request of sending an SMS message.")]),t._v(" "),a("li",[a("code",[t._v("202")]),t._v(": The parameter is empty or invalid.")])])]),t._v(" "),a("li",[a("code",[t._v("complete")]),t._v(" ("),a("code",[t._v("function()")]),t._v("). Optional callback function for completion.")])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("message"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("send")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n address"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'198900086'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n content"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'This is the SMS message content.'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'handling success'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token template-string"}},[a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("handling fail, code = ")]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("code"),a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[106],{532:function(t,e,s){"use strict";s.r(e);var a=s(28),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"text-to-speech-tts"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#text-to-speech-tts"}},[t._v("#")]),t._v(" Text to Speech (TTS)")]),t._v(" "),s("p",[s("strong",[t._v("Text to speech (TTS) functions.")])]),t._v(" "),s("h2",{attrs:{id:"manifest-declaration"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),s("p",[t._v("You need to declare the use of this API in the "),s("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),s("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.tts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"module-import"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),s("p",[t._v("Before using this service in a component, you need to "),s("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),s("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" tts "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.tts'")]),t._v(" \n")])])]),s("p",[t._v("Or")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.tts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),s("p",[t._v("This service has the following method:")]),t._v(" "),s("ul",[s("li",[s("a",{attrs:{href:"#speak-text-queuemode-volume-success-fail-complete"}},[s("code",[t._v("speak({text,queueMode,volume,success,fail,complete})")])])])]),t._v(" "),s("h3",{attrs:{id:"speak-text-queuemode-volume-success-fail-complete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#speak-text-queuemode-volume-success-fail-complete"}},[t._v("#")]),t._v(" "),s("code",[t._v("speak({text,queueMode,volume,success,fail,complete})")])]),t._v(" "),s("p",[s("strong",[t._v("This method speaks the specified text")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),s("p",[t._v("This method requires an "),s("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("text")]),t._v(" ("),s("code",[t._v("string")]),t._v("). Mandatory attribute with the content to be spoken.")]),t._v(" "),s("li",[s("code",[t._v("queueMode")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the mode of the queue ("),s("code",[t._v("1")]),t._v(" for add to the queue and "),s("code",[t._v("0")]),t._v(" to flush the queue). The default value is "),s("code",[t._v("1")]),t._v(" (add).")]),t._v(" "),s("li",[s("code",[t._v("volume")]),t._v(" ("),s("code",[t._v("number")]),t._v("). Optional attribute with the audio volume from "),s("code",[t._v("0.0")]),t._v(" (silence) to "),s("code",[t._v("1.0")]),t._v(" (highest). By default the system volume will be used.")]),t._v(" "),s("li",[s("code",[t._v("success")]),t._v("\t("),s("code",[t._v("function(res)")]),t._v("). Optional callback function for success.")]),t._v(" "),s("li",[s("code",[t._v("fail")]),t._v(" ("),s("code",[t._v("function(code)")]),t._v("). Optional callback function for failure, with the potential codes:\n"),s("ul",[s("li",[s("code",[t._v("200")]),t._v(" General error.")]),t._v(" "),s("li",[s("code",[t._v("202")]),t._v("\tInvalid parameter.")]),t._v(" "),s("li",[s("code",[t._v("1001")]),t._v("\tNetwork connection error.")]),t._v(" "),s("li",[s("code",[t._v("1002")]),t._v("\tNetwork connection timed out.")]),t._v(" "),s("li",[s("code",[t._v("1003")]),t._v("\tVoice data download is not completed.")]),t._v(" "),s("li",[s("code",[t._v("1004")]),t._v("\tFailed to play the audio on an audio device.")]),t._v(" "),s("li",[s("code",[t._v("1005")]),t._v("\tThe TTS service failed.")]),t._v(" "),s("li",[s("code",[t._v("1006")]),t._v("\tText to speech failed.")])])]),t._v(" "),s("li",[s("code",[t._v("complete")]),t._v(" ("),s("code",[t._v("function()")]),t._v("). Optional callback function for completion.")])]),t._v(" "),s("p",[t._v("Example:")]),t._v(" "),s("div",{staticClass:"language-js extra-class"},[s("pre",{pre:!0,attrs:{class:"language-js"}},[s("code",[t._v("tts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("speak")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n text"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Testing, testing'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n volume"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n queueMode"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling success"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"handling fail, code="')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" code"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);e.default=n.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[109],{535:function(t,s,a){"use strict";a.r(s);var e=a(28),r=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"vibration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vibration"}},[t._v("#")]),t._v(" Vibration")]),t._v(" "),a("p",[a("strong",[t._v("Vibration management")]),t._v(".")]),t._v(" "),a("h2",{attrs:{id:"manifest-declaration"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),a("p",[t._v("You need to declare the use of this API in the "),a("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),a("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.vibrator"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"module-import"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),a("p",[t._v("Before using this service in a component, you need to "),a("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),a("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" vibrator "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.vibrator'")]),t._v(" \n")])])]),a("p",[t._v("Or")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" vibrator "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.vibrator"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),a("h2",{attrs:{id:"methods"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),a("p",[t._v("This service has the following methods:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"#vibrate-mode"}},[a("code",[t._v("vibrate({mode})")])])])]),t._v(" "),a("h3",{attrs:{id:"vibrate-mode"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vibrate-mode"}},[t._v("#")]),t._v(" "),a("code",[t._v("vibrate({mode})")])]),t._v(" "),a("p",[a("strong",[t._v("Triggers vibration up to 1 second.")]),t._v(".")]),t._v(" "),a("h4",{attrs:{id:"arguments"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),a("p",[t._v("This method requires an "),a("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("mode")]),t._v(" ("),a("code",[t._v("string")]),t._v("). Optional attribute indicating the vibration mode, either "),a("code",[t._v("long")]),t._v(" (1000 ms) or "),a("code",[t._v("short")]),t._v(" (35 ms). The default value is "),a("code",[t._v("long")]),t._v(".")])]),t._v(" "),a("p",[t._v("Example:")]),t._v(" "),a("div",{staticClass:"language-js extra-class"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("vibrator"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("vibrate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mode"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"short"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=r.exports}}]);
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[114],{539:function(t,s,e){"use strict";e.r(s);var a=e(28),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"zip-decompression"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#zip-decompression"}},[t._v("#")]),t._v(" ZIP Decompression")]),t._v(" "),e("p",[e("strong",[t._v("Decompression of zip files.")])]),t._v(" "),e("h2",{attrs:{id:"manifest-declaration"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#manifest-declaration"}},[t._v("#")]),t._v(" Manifest Declaration")]),t._v(" "),e("p",[t._v("You need to declare the use of this API in the "),e("RouterLink",{attrs:{to:"/guide/manifest.html#features"}},[t._v("manifest's "),e("code",[t._v("features")])]),t._v(" member:")],1),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"system.zip"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("h2",{attrs:{id:"module-import"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-import"}},[t._v("#")]),t._v(" Module Import")]),t._v(" "),e("p",[t._v("Before using this service in a component, you need to "),e("RouterLink",{attrs:{to:"/guide/scripting.html#import-and-export-modules"}},[t._v("import the module")]),t._v(" in the script section of the "),e("a",{attrs:{href:"../guide/ux-documents"}},[t._v("UX document")]),t._v(".")],1),t._v(" "),e("div",{staticClass:"language-js extra-class"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" zip "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@system.zip'")]),t._v(" \n")])])]),e("p",[t._v("Or")]),t._v(" "),e("div",{staticClass:"language-js extra-class"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" zip "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("require")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@system.zip"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),e("h2",{attrs:{id:"methods"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#methods"}},[t._v("#")]),t._v(" Methods")]),t._v(" "),e("p",[t._v("This service has the following method:")]),t._v(" "),e("ul",[e("li",[e("a",{attrs:{href:"#decompress-srcuri-dsturi-topsize-topfilenumbers-success-fail-complete"}},[e("code",[t._v("decompress(srcUri,dstUri,topSize,topFileNumbers,success,fail,complete)")])])])]),t._v(" "),e("h3",{attrs:{id:"decompress-srcuri-dsturi-topsize-topfilenumbers-success-fail-complete"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#decompress-srcuri-dsturi-topsize-topfilenumbers-success-fail-complete"}},[t._v("#")]),t._v(" "),e("code",[t._v("decompress(srcUri,dstUri,topSize,topFileNumbers,success,fail,complete)")])]),t._v(" "),e("p",[e("strong",[t._v("Method to decompress a file")]),t._v(".")]),t._v(" "),e("h4",{attrs:{id:"arguments"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#arguments"}},[t._v("#")]),t._v(" Arguments")]),t._v(" "),e("p",[t._v("This method requires an "),e("code",[t._v("object")]),t._v(" with the following attributes:")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("srcUri")]),t._v(" ("),e("code",[t._v("string")]),t._v("). Mandatory attribute with the URI of the file to be decompressed (it cannot be a temporary file).")]),t._v(" "),e("li",[e("code",[t._v("dstUri")]),t._v(" ("),e("code",[t._v("string")]),t._v("). Mandatory attribute with the URI of the target directory (it cannot be a temporary file or an app resource path).")]),t._v(" "),e("li",[e("code",[t._v("topSize")]),t._v(" ("),e("code",[t._v("number")]),t._v("). Optional attribute indicating the maximum size after the decompression, in MB.")]),t._v(" "),e("li",[e("code",[t._v("topFileNumbers")]),t._v(" ("),e("code",[t._v("number")]),t._v("). Optional attribute indicating the maximum number of files after decompression.")]),t._v(" "),e("li",[e("code",[t._v("success")]),t._v("\t("),e("code",[t._v("function")]),t._v("). Optional callback function corresponding to the successful execution.")]),t._v(" "),e("li",[e("code",[t._v("fail")]),t._v(" ("),e("code",[t._v("function(msg,code)")]),t._v("). Optional callback function corresponding to a failed execution. The possible codes are:\n"),e("ul",[e("li",[e("code",[t._v("202")]),t._v(": Invalid parameter.")]),t._v(" "),e("li",[e("code",[t._v("300")]),t._v(": I/O error.")])])]),t._v(" "),e("li",[e("code",[t._v("complete")]),t._v(" ("),e("code",[t._v("function")]),t._v("). Optional callback function corresponding to the end of the execution.")])]),t._v(" "),e("p",[t._v("Example:")]),t._v(" "),e("div",{staticClass:"language-js extra-class"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[t._v("zip"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("decompress")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n srcUri"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'internal://cache/test.zip'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n dstUri"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'internal://files/unzip/'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token template-string"}},[e("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("handling success")]),e("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fail")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" code")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" \n console"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token template-string"}},[e("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("handling fail")]),e("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" \n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" \n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]);
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment