{"_id":"react-native-azure-iotcentral-client","_rev":"47-cebc15096d7bfa8f8105cad1ac0b7345","name":"react-native-azure-iotcentral-client","dist-tags":{"latest":"1.1.10","beta":"1.1.8-b.4","bundledep":"1.1.7-b.3"},"versions":{"1.0.0":{"name":"react-native-azure-iotcentral-client","version":"1.0.0","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"ISC","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"^0.1.1","uuid":"^8.0.0"},"gitHead":"0432db70d466a2ebfffe85d3e6599bf2e88ed9fe","_id":"react-native-azure-iotcentral-client@1.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.13.0","dist":{"integrity":"sha512-x89UhhlWMnv6ACoHEQGe+mentMRKoJrkd+7x3O1QIsvXm72oDQWtgMrEZdEYfCg7FfvUwyQSisn6CNP9LQ3Dsw==","shasum":"22ac44e0971b9f22ebe69e5d3c91b0758b2a8104","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.0.0.tgz","fileCount":34,"unpackedSize":84054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevCC/CRA9TVsSAnZWagAAzLoP/itTLNafIbZVEklOWevN\nFSmUzruyw4aPQFYJ/mavJhAJO1W6nPdWXpT+UIJgdVYPsofsXeX9il6D0BEx\nJIrTwIXfXLXuRSffjaog2jSq4QJ27EdqqMHAQ4hYadbGvKlpydeNwXrH0q2V\nLlpmj0puyykw6xsST/Js0aqvm/yHKSlxLqkDUx6VObP5nigAhCMfIGnSFbZO\nuGlbZyuK8YC4UrAO9T/Xo1wqroFT5937N3Sk7sof08TiR61r/zgDxoB+H+xM\nHysV5/uazEc7EYK9rkh6DEuMVt44WLJmIS81xCvpKtajDqOxh9TNEMYATMu+\nGjwuIXLb7SzJ6EmjWymrTXqvRmMwh3BitEd4GL7GYwWwmT141VgcYm5TES9q\na3oGZ3nz3mVFSNbJ4x8/DDubFmbOCJJSc+5fzxTq3T869ReundzsTiKbxTKk\nlhzyp2mMMp0d1xNT03OvOCMzHzz8xYPT+CH+HtvJFqD6wDQbu1UjEUnFKWmm\nPIcyo1DWCPK1hKr3NoN2RgubQes7/riUub30c50sCogXZDqr8oEHGgaC6cGA\n1TItrqkJ54+WTstpZ+taaem6oxryz8dkjFG3QwUE2EB8P/DwOERYG2uXZvzm\nvFHJM0bRlyJoefR8d3VfZovMjeIToLIfOpBiixS9MCWxz1XG28N45lZSsvVu\nKURW\r\n=h21F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHxln2w7Zx7UJdW01ypA2AqIzwe+Q4bFq9G6T6sDzkKhAiEAh6XHmjnUhvwDFeqzwUcYsVhrei5G0VQyfGNrZAsL4SI="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.0.0_1589387455092_0.16564032579079546"},"_hasShrinkwrap":false},"1.1.0":{"name":"react-native-azure-iotcentral-client","version":"1.1.0","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"6fe303ba9461889f7d822a1430b4a54399694416","_id":"react-native-azure-iotcentral-client@1.1.0","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-yR+BCUXyDT0msJ6f+dpGcl5lGwLyjN9yVAiIt61d4vCcFe7KTQMa5tfPocWQHzB1d0aglaVnhUnpiJvta4ypEA==","shasum":"d1c15ee6f9ae681b8a9dba5beaa4b8744694487c","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.0.tgz","fileCount":90,"unpackedSize":287922,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezUtiCRA9TVsSAnZWagAAPEMQAJIlSvlh6URXocVYN4Uk\nm6th5SEAdCGMYN3Ti1IQ+ODnHQHvwBB+YSUt7jF6lbpxmk2bBFeCAWu/G82D\nAuBmQoPT4P8octqGkY1NSGyD2M0e4jwsHPQcCC+i+lWaLn3+dkHFWi7G1PBt\nRhcwK7TwBe+ujRvLu21dM9rOC8JhkkZcBOdtMlIkMAhbPy5EFugE4XOri9yH\nXC0QxQTeBLlwR1GFy19V31pTe4eNf1XvWe08jcnM8MSs8ssY5XFYNezyxye8\n/st3td0UxDy2gbdg4f97IceBx24Rs1qIxaKp5NvdtVWOHQ69/BKadg+FFKwH\nqTONCM94EoUVICUT796B9n+8OJnKz/Q2BeATsgX3Sn0umt21sb38e+6/DTvO\n/iQc3HvK4HDubWZYdDL3Hxv2/9c4kJlpazoiSxzp1PH2rHwegYFx6i2TsAJY\nX3IHepcmL+kKELtOA/66UBDRhurAgBvAyZmouolDh7cz8Zr7hWue1n0w+WI1\nwDGvm500bjsInAdO2P3fTXKmroynfshechOVCRLNF5KZ6B8RRhTgK3d966x0\nCNDxYh3gfW6hbTUVDBAB54SICwbzbOXI2qtjx5OPj9GTMkW7kCrOmgoyu+3o\nfob6smNuwWWzELQMIN7kuRaPwXuDxr9pVsX5Y+Ku74DPfzDd1jaEJYGTOeZZ\nLj3f\r\n=OHvA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwzL+NyS2CYk/ww7P1UTxPW45gUIiVpP2JdtRAlQpJQQIhAKiFaeBGfREmxCDDME09JOIEvo+7IwkZyulAf5tJ12fr"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.0_1590512482262_0.14078433649431066"},"_hasShrinkwrap":false},"1.1.1":{"name":"react-native-azure-iotcentral-client","version":"1.1.1","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"b245c98dfd46ed7ef48144e8b9b441fe7466ef35","_id":"react-native-azure-iotcentral-client@1.1.1","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Da5o5glYREFXXKXnk7CxFjMWqOhFPr4ZTG2CgRPqcuWsEgaVPZoUzzRMG2F9McKli9LAMyImoiWtwCZuxFQnbw==","shasum":"16679f6cfc9596ad99ccf032bd2cff35f5d3927d","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.1.tgz","fileCount":90,"unpackedSize":287928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezUyUCRA9TVsSAnZWagAA6o4P/2vyyJnOkYBhOPWRJR04\nkB7jBwVkcbuiNbiiGLawJ/iL9l8hJVmgNgBlJUIKWuCFFDuLlcKXqRJlNwxX\nnyB0ABAcEAm1m9b5RBNXUALtDtt7FK6rDTF5CEabK5Pm04n2VpJl8Kko3367\nshPZv+wYREy9nRYg0tLYzEQoU52O8099KocGVT16cqbPRf8hxJdZ81i9RCaj\nuJqKwQ/fBCzT+5oAfE996KNIjiSzTuFkS/qB7LTG+MTDcp2YEZCtF1wietyn\nWqd5S8/2Yv4EVfEIXQH3G/jtDmS3MPhi4c01PeWiaYcPvb16xujZn9B/Lul8\n1wrl3zxIY5ErSiyLrNUN2131wRS6/zeKyoOjenS+8w74/r1AAF64Elsdijwq\niY4HPoUmPg18eYIyA+AaLJWrPxGmfQysjYilmaSoL7+zCtuMIPz+bYsN01Lv\nJ5F5PwuIwD0O4IBUy8ky36yapmf9zpY+/+yV2aG6owMBOSawVQN51qzFri3L\nreXpTlBbuUy963SRUcIB63Yr778ZaRvw56iHSyl3fmUhosfNwc7Xxhkrh+TM\ne7iTavRBgB1ur/XOV9Qn0uCaDBJ/uqsqDeJxEiFgHJiLp7D0BqlhSKHBa1Tt\nRCRhqKSDO1hcBe2vNZd8ltGVCW4Q51hyMntak91/R2/XEzhH/PyCmUG0tMFj\nSPcW\r\n=AHbP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcbwrktjuspgJX2+hZqnbH1JEfjySV0T2Sgdu0mh+c/gIhAPwVCok8t3egHaK7RpkUnJDjQEaSI7Si++N65Ij9aKl3"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.1_1590512788343_0.06390101345611443"},"_hasShrinkwrap":false},"1.1.2":{"name":"react-native-azure-iotcentral-client","version":"1.1.2","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"93d86c6bb4e4f18c85a5e8beaa05d76b2ba36d0b","_id":"react-native-azure-iotcentral-client@1.1.2","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-G+2HIZgLD+PKnR1r58OvsfImcf+f1Hp4FwRd1Qyn/cKWFl8SgTOPWFbyTJMS9xbCBZgP/YCoPMmzse9G2Vti1w==","shasum":"d4e87836ad838f2f39a55542510eb301256b304d","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.2.tgz","fileCount":90,"unpackedSize":288002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezU05CRA9TVsSAnZWagAAFLoP/iTDrEjwOrvUS728RBZr\nAsfPuV6LCt7sW075RBhm+aoXWwM6vwmsGAR8jFIw0I5xJgUsPsYE4GpriM9y\nxPt4GBGn6JbdD4FS4wMELcWIjQbZdfX7emVggGdvZsEdq+bBqWuwu90wOUC5\ny6BqtdMn96y/dI2ZABFaViTuE7RhMkKPKs0cr0JL063exuy8HSnSq4mvJVct\nFt5CJvH4wC0/5uM0K9uH3lBqJESNgr3Z2NZAYI9Cvj4hnjKjjfj5aQCaYTRJ\nfCbrBrrSpifuq7/QFWdwz4zOWv1gKhSZkyprjpbnJnTrtopdglfw5PVWMO6Z\nmSQm939OVcjnzmTYGXSkN1bTLUKIXLaLIySJM0DWA02K5U+KG+bqCqEjRCKv\nxoM35/oXaBF+QF+87oABkHh1CdtNdpEMPqW1lQPI/mkpyuIXll8bBCrClYz5\n2BLsSMvdwvLmeCIKuwwnd0wZWhPG7Pn71Gok4fPjZ2e4QtHwT/yEUiit1CVw\ndxX27dxPeiNO36flwnrN1olY7/oOdsxZYE87GDy7UCDT3kQnECjpwcHb/PI2\nDA2ykZqcobsflWAOYOrU5fQBDUrgkztqfNaH3mJbEiChgZK30kXXMVQmsS9e\n/5dHxHNslHdb+oXBbnR8qE/QGs59+H60oodMjg5NJup/UMuTHHs5XN6nUASo\nVpQd\r\n=zz7X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEWM+i6Vxp2DaK4yF5vK/UV8lzWf284XLafzBcsIspb/AiEA0eGbetNFSVLyUH7SFNj2+QPg5l9R0q4FnxfFS1hFZss="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.2_1590512952765_0.1507196171337828"},"_hasShrinkwrap":false},"1.1.3-b.0":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.0","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"8890efefddf6d2705a064e03943e4de9ce4c9f97","_id":"react-native-azure-iotcentral-client@1.1.3-b.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-j6M13SnQ9/i7cS0hZYegczXuMHQXrsTwxHZhmvii/8IISWiZw8eOtIXywt5bhhcDOjITmoR29o5edV/1BgfFpg==","shasum":"77fea8f9dda35b865d58dc20cccba3d13d260899","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.0.tgz","fileCount":90,"unpackedSize":289542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfO/eTCRA9TVsSAnZWagAA2qAP/i2ZId21MD0tDE9OLZk0\ng39cWmRezfQMtKriD2WAbBgnscid0JSjA3flNiMaIC0RJ4oKxfa1lbaGbQ1l\nGuJPdO93srESEPgeklVSzh5+b2eDahck1E08dYi5JNJSD0VOjoBAk+Zrcy11\ncOOO+phqnM+uLx3EANQfk/sBrKhbSHPnfYdON6BXpBoRqhRtHbglac4gRF92\npC7q7ESqTJTN/YUDeOyaXLQqnCeVHP52f5x1hcoVLiFkaTvt3911xddfXirF\nb5RPFqbFS44OYmC/cy/hWVn7qmHHiQXkXxuRiHh3zrDTE2XeWni1DUwP4WfZ\ngjIY1vDA5OOyTsuxJTwE8x0whsBySxX4n43Hwkn0wn8fSx0ARIZ+Y+fQWw1c\nOyBX3StyqAh3ONp+ybEvrgpj8InzGAx72rLT4Qj0+Wa266kIChkK4AD5+UCL\ntPAMJ+s65nkoS4VOjVzFiQy+SMW3Zhu/ve/HuCtP3zn7ZV8Lw0Yvmj4MGAgk\n6xgpjvxJ3RUFzvNoJ8jL5IFFsXm90SeU9VhWEAyra2pGr2IowbnDsob9mgTq\nDhwJxlbCbCcTiJ6bkLgnRHFkIABfpubJrueIKsQ4sw4pxYfdzOZ8MX2yISdr\n4FhkaoSjKAP5zBiAI6QxVZ3hWqINdzk8zYygtw8QnAYQCgt765aN29Sw7uG9\nAmZ7\r\n=SMWk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkbwOjkfE0896v9m8C4TLECosysJf5a7uKOTT4Vx3pswIgJxthwKJZ+z/fAIxJPVog9PXuXZzJsshtQWqt+i9163I="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.0_1597765522776_0.24305923419885778"},"_hasShrinkwrap":false},"1.1.3-b.1":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.1","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"882b1421a8f8c7b39232dbac9396733c3a9001af","_id":"react-native-azure-iotcentral-client@1.1.3-b.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-6Msj8Jdr2gz66WWF2I1CqXT7fCmkJrDf6iAl3WEqgYfZJNW23R8NdQEwrgo+bPd5acEUViM3J2g8kE/nmuABtQ==","shasum":"61234ff4fa5130f7ba6f2640266b148b8673dcda","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.1.tgz","fileCount":90,"unpackedSize":290047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPAyKCRA9TVsSAnZWagAAgH4P/392fnbc1jIXVAcLfFgv\nZmg04XOP2MF5yhkiTJCeRZTUUYu6uLo0tqQWPsCnP4IlvhwsBV0MmM82ObZQ\nvFo8jsIYUMZjF8wMRk2LBfRM9n84+3dYlktzvyvG3DulZmpWB16TAQkPeQxZ\nsfFhzBPnAEj3wCTZcdfk+uAtpNcAUs7XR7gZYkS3N0PHP5Xroc4+SapDpc/j\nUdoU+WNGjQZd5oSe03YFzyVHo70K9KuuJG6/ANoAykSdAEDQIUsQnDAElw9p\nVEYINGY/6S34l5rk0aMweHuUFpy7HMxIJ9TgtW4L0uC4L6kGVUamZuyq80F6\nepWVgehHXJ+9ZGawruvOQ+YscLQ58wRDoGRyvW/5YDRX6YjWnE+cErsNV9Fq\nUM4nK/jCyYodO5lkzzRLxb2eV44LZi3MDzWz42UK/RjZGRGMyenB6TBLHbVy\nuuCKFwbniGSoAoa9mNuC0CnZxQPKhcQFVJkCPwmANEHpO+4uZDEZOgWOPhi6\nVydfG4Vty/DaJU3AZOPJ7JZqqWyYCusqWkORn975VMfjgtfF5k8WlSwrcvf9\nmknNdb2bI3tnmQ7EOYfh4Q9IW/Z8C0Yj1Lnh89fM+Vl5WLlDxozYntt2hlDm\nrC6Wj+jhz2ja/tB47XPlgCEt15hqPSfVcVFpq0qmINSv4cLIVKmOh0Phk6A5\naUZS\r\n=CPQN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQ2MITO8jcPMCzJokbTOmEuYxAXUOG0BAha/UCWOtzIAiBSyawTEuuFCE8kw0HIFKvYs5MIuyXAEQgcMqcNl8cPgQ=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.1_1597770889853_0.6238429837780184"},"_hasShrinkwrap":false},"1.1.3-b.2":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.2","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"9c78c7743b3107777d452ea5502eb413fe25c004","_id":"react-native-azure-iotcentral-client@1.1.3-b.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-aZH17TxwVImrjpBag5mNjkcXHXW5atVJKqb5MLIyaGQCkvg2VJfQZM3gi1PN2GqeGzFT1PVOLBtVe7euKnd+JQ==","shasum":"0058e5d408149a1642cf17b3554cdc7dc9246a20","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.2.tgz","fileCount":90,"unpackedSize":290930,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfPP8KCRA9TVsSAnZWagAAQc8QAItIM6xu2WRsXjYUMeZj\nP7FfW2k1MLa+aJaXjJ4wtLfMbm92LxGBtzQFqaATXI30UzMe4KkOvCbaVZQU\nN1RBUWi4cKlL1G2DCfTxk6pl3BK4EcG1f1NSn51X+l5Zq2Ur3mGMJg2HTW0D\nXpsrfA7VoL6zXsLWgT5/qul5eKvPfi8P0aW3tT4QFVdAMnPUhpqJsDAYTwm6\nYLASh5itbCAuone/TlkkynFguWABeXIcPkuLxzKyag72Gq1M73spZDkTq0/o\nt2WaHywoSs3wHPDJPGwAUNZ71b4/GdnSMHL14V1WZkKR1xqH6wTjBkeJC86p\nVHW+QjzpFXMFCAewtBypc4LJI4LBpooUL/y1KHDuhea4Qa/cXJSyhIWqnvAq\nokVRStCMUXozz3Aw6gi9XeC5Afd3c2sRI80i3aZdw6kifrFt12/EbzJYTIhf\noDNFPPOWQ4VYkeY0eH6OR5URWMTdDKji2VwzgWsP1YzYFS9r6zP5yLW2ARFI\n7bWJ5qnRPUQJc7AqDsp3EC+ZgXmAIAibTTiwoPQ/fhIR/h6ak7YQmb7ssbnS\nOcXVuEG9ZyaNom2SCbCstB64E2AUD/0umL0P0+dZpe5A2dOpOyRz7FZvQjlp\nAuKUhvJdNO/32V9DcfFQ5H2daBmSgmc2xJJ/ZijmOkp7praKIyCwI2RIL5tz\n0wwt\r\n=3pWM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBIrdmOtUB1qnOD2kLPZJVdwJVwufm7Jj/w9pK8OEPkkAiEAvsalWvBzirMgeFYUIhNZdrAGx9EuY129D8PkZd/4jeY="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.2_1597832969973_0.26442317052029773"},"_hasShrinkwrap":false},"1.1.3-b.3":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.3","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"f08d347d242cecd07a512329fc3cd622e5e32b5e","_id":"react-native-azure-iotcentral-client@1.1.3-b.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-10L2irbNR0J7c3FvYCRvp2BbZWKiNdCLfD+f2eocD0ChE38MBuM7v8wrBvEHFqKvR4dW3Hfkwj17uu5Q5cSV6Q==","shasum":"8da88a1ea6bde7db9f004a27c753bc696c476534","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.3.tgz","fileCount":90,"unpackedSize":290968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP4zmCRA9TVsSAnZWagAA0VoQAI8iFw0UbSfOdVFsBpam\nbA74+5PwwrmbdBDrhInMl/WUXfa9OfTtD9bK8IXo83UVlPEquWMhwQfx6ep9\noxYZn3+7TFQNJA/yWHZVkMlCAweo8exbr7+v/ugcbEPNb9HjEALLolAKzTbu\nKqwcL4ipzgpLcUa8D0HNEZ3WrJH7oNrMSz8F0P+d5cystXo2w04V6z0mcBcm\nbbgPEjrx501SavH2UPM++3RL4Ljx9ZFXF3EWMfFtOj56p3KIrIXaQ5cRrE+o\njEc/142ktCL2/oVapeNTC2SjrdVKRYQ+3vECzTxORf2VLTAVpBBDfPwaBiPO\n1vTSY+0q7GEe7zk9RI1sLKRhvqtxxNHyiIlqI+D6DKh/CAHgx1mo4WDv0OT9\nIn4Krio7QefRRkKg8ZRFttagyS901+05xsbaGtC9I0edM+Sb0MezWACaEU//\nEW0pTWnf5xTGiicf+eCO2L/z6lyI2okVyVRstm/7JOhnHpJpL6MOeU7W2R1j\n4xJ7hhpDaoMEUrRAKudhd3JqVep5p+6I/iQ1mVHjEOjYnCP9NDoOcNN/4ArD\nHqYM6G4Nat/cAnaqXfVJ20dS5LJRXrbziJeXJtDCxT2i7f3ZXMXkL2hnb14p\nM+dpOMvZUZpKv27qBF4DFa2xF3nypvJEkKfRepbAguj/c4inUhKUKirc7INb\nxdEM\r\n=2U7L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFWJyhNtiDWYkBnjjegekD7PO/CJaghlPcyTkMNpSuQEAiBwlm+2+johROu35bOTmZcita9ysgOBbjMvSwh8fUzOzQ=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.3_1598000358231_0.40458393181283037"},"_hasShrinkwrap":false},"1.1.3-b.4":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.4","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"457e28a19fb8744a199785b534b76ff62c10ce52","_id":"react-native-azure-iotcentral-client@1.1.3-b.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-2dCXQaqvNnlPrHbATvG8wb9UYjpNrNoLBoWjL3eON1ZDme43M0dMl7FkWWUSaPgyNo6T+8cva/2+ansnqg4qJg==","shasum":"95b3a6d70bee2d4b584ddfab4e36a377976fe829","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.4.tgz","fileCount":90,"unpackedSize":291020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP41OCRA9TVsSAnZWagAAF3MP/3E+aBwz6HFgjmpkwXFV\nSzDpoXJ+mpiiw2J4knR0NoIDMzIte8LZ9CBZwKZ4KbGMbMrJp7RWB8Awgusx\n49m4xB65Q1WxjhOZE1L+cx7r+eP6hOBr9q6EHPGd+ojk5OdGTKYdgDUinWTP\n/tcBVOztCG45XJMtXleveEaq8m5ViLrHZZDR5fosFGrv6U47FDAJQANEiBN1\nYQAoYPfFwubSI4VWqgUsYOVhvX/UTa5NZvkquRNWXlxCyhUmAtCb4lTNAtZ3\nAZL/TvaH2OYVbXMw+2WFEO2Z0emyh955V1tLqBidVRVrEMfLIUro6v+vqLKe\nJ/PdG70BeeuGHdtlP9FbpxnEp+oI5X8POOqj9tffqcbBllXgnBZMEo+HtyqK\nV9A0lpu80W4eRiH9mmZ0TRdRpsJhmHPxvCurU6vIC4YRWHoU4D7FErT+0TJk\nXYrgpmqeUi4miqYRYVBEvhidZRLR26Jbta3/q32ji+dXSbxAZAfeKOwrhy7/\nQN06aIFzChUuZ7N9a2ONQDjt09x7Owu8zkvwsFy3C5asRbQ4jvzh1JWXnRY5\nGMVoJ/LFp24MsiHR0jgbuxeNL5rutLSqQXaFi9/7Sm1NCzcb4tp2wbVFkyna\ngYrrc+LuxvuLe8mM9g4CSGu1ZUxvyv1psNsKk17GENihn9CbNbqHm0Fe8SfS\n08aM\r\n=+hKr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHGDlV2Vk6dDioHiqpp3LG1+huYx50D1RJk9sA19Nk6iAiEA1uB4hgikBUt4/914dpW/5EAZYYG8qKY8U5HI7xQz7vI="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.4_1598000462061_0.8640747791090919"},"_hasShrinkwrap":false},"1.1.3-b.5":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.5","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"47a2bafc47bb2921c8c7a304200be60b51fe96ca","_id":"react-native-azure-iotcentral-client@1.1.3-b.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-on2vTAjVh04TljabD8H4OyFxLtthm6jOExaKWOlcstwz5yiTiVFH+ke1XXZvTybdNjj7pSy0UbqQWbbfR3O0Nw==","shasum":"79c8107ad01b6fde3316fff6959429734315d51e","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.5.tgz","fileCount":90,"unpackedSize":291000,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP43xCRA9TVsSAnZWagAAd7gQAJgQaJ9iQ9kkPzG1KiBI\npIfriw9c2wk60ZFnaNbIqo5/WBBXPbTirWsCOJOspAXlh81U9UzKrkBVSgfr\nQPGJ2bfufKufikfpr49VyVthyC7eAgbIQsNQp55j4YEBMHN899btovIlp9aV\nBgsyfEuTYnlofc8+pr+LrwU1EChm/yzsRKiuXC0zRR4FEk6J6Zk3wx6Ks5X3\nNAzBjsPPjlFIt8AXk1GDYDr9W+WmgmjB3W+mx10ZTPulnQOnHqyccBj1kdW8\nOtUS9M7yx+S4rNqooIyjZIJKzy/jr+RUtjza9UWjrx6ddEkKRunpolV/dIhZ\nBjsGwkoohS1zN+1AHvDi0jUC7h2ia9r5q/3DyqhZ1HMDEwKnoY8qMGjjM4M9\n4ZVFZ+JkFmOfsjH4Ywqd91W2Hmaq4rzM6kuW66/Ls4Ba097+c9ONASS/Q7GW\naeCyJPCruJyMQePUqV0hNNNePhEYI2KZcFcNZ3uIqtCx7r0U3JfyhPXoI25c\nE7YUXSLoZlU9vbHfTT8KzfVREogo6Z9UvMKs/AG+mCfSrAcRe6UupE4QDLwA\nMPMDpHQct/z82lQ4pY+q904rEpI5OOWew54ouZ/7lm0qfaHWTgVZonoxtRoB\nsJ5vDI5gENPMItpUz+z/X3/gh41Bv5SOYW+71qVAfW/EchgSr+Oy+vDoxESC\nDw+k\r\n=kqL+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUBqxPhatq8GV3vRm/o2UDUb0G7jfioDcRfmFoJfVvcQIhANfUDIYZkWiBNiKewsFrw34I9uq35oHIiy27/BMl8+AB"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.5_1598000625494_0.1923562602545692"},"_hasShrinkwrap":false},"1.1.3-b.6":{"name":"react-native-azure-iotcentral-client","version":"1.1.3-b.6","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"3057b19b271c64a590ccebb358f2dfca5f661ba9","_id":"react-native-azure-iotcentral-client@1.1.3-b.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-wntwzTA3728PwQwMawbUJ+HHRbG+dsBolT+hE2eoMGTn0SPUwC0T9ij9nMnDSK2mpnUlQLlk3Td7OMfrKIqBWw==","shasum":"34e18a1d8dbeba36d4755d5f63ccf3e73ea2226c","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3-b.6.tgz","fileCount":90,"unpackedSize":291587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfP4+4CRA9TVsSAnZWagAAHPsP/0Ko5EFSIo3pnV3wyiP8\niR2a7kbCNwf5y0Q6Cmh+jX5SIGDN3k1s89DOSsM7JR316hblJ09IFGHSVsgm\nJtUhS3DiLbzNoVkSOxET0W8FnbB1EIq4n1MZut6W9UwGLwH0ugoa0nf6yoCX\n70lIsz3NtfLh8hrkIldIXKcbjV61KjcAIm216mMjYNeRk2PJm+K0vpX0QWJU\nhCDLui47nYH7D+/A30Y+bPaghvDCcAeevsSJv4HThIe/N2joUVYYTiuXqO8i\nriLwEgEttEZ4MtYyx5I0rYFWCd4w6JYLCxdJ6JnLcRweNmRTGHURERICeavR\nyEMxixDE+X2ImVqvCv+nDuqH5mpIZWHCL8OM1IghTNw2OA3H1YA4p1bMU3sP\nBhxQ87T7MVNquSKLcmquvmXOiEQQl3/iajKeoXBl1u/o4TeLj8Y7dUfYsfNL\nfiZhUi5eoMV6ZDzF/f6GkMo2ZM/AvX3JbDiyIC9e89A49yUBrXXwuiMC6XZ5\ny2WmhV3jtSeL3EfKEaZLUs1AHMa9KrbV9XJhruNRYeAkPnIA/IwxkanBpVhG\npejcyiMSGQNE8QYa6wrEEtahOfgf9uAbMl7IyaKrXsTEcD/UTdfugSnS0+vb\nQh/ANEhCFzY8xxxb3Z2Vq8Zz0UD6aam7EDbxdCDwxz1aEcc4KizzIWgQCyFj\nTiMQ\r\n=HPKv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkalmon0aEmThOQxbTgZOnNgfHI7+LO7QDw6/PGNdqcQIgRYHAupZNURUyHijK8yNWi7VDgddQVQaZW4OY6+IkCOQ="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3-b.6_1598001079462_0.5725137961952664"},"_hasShrinkwrap":false},"1.1.3":{"name":"react-native-azure-iotcentral-client","version":"1.1.3","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"a8bf9ae4670d9f9db176114271d63fa7ffd0ce21","_id":"react-native-azure-iotcentral-client@1.1.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-38Qe5uHXEAdXvQ7ROP2rflcliUr0kA8slDmAvbMdpKwg9owIr5BHx6kYoeuGQe5IVo7TprYbFGsCfw8n1S2gSg==","shasum":"0cf8cb182d9a6f605723991fe99d74da1cda4a99","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.3.tgz","fileCount":90,"unpackedSize":291583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfQ8zsCRA9TVsSAnZWagAA+JoP/R8zn3m6nRn+NiDxLLHL\nFaciGrF1pxSmbd6IFjXPZt7jvoaMKAO1LfzCDei5JT5I11q6heVZ+UIamMbH\nAhnlTOTWAdoqGL6lsljiThFUfJRqVgWJXpst9evzlss6A8PLixhIAIqTNkj5\nkL6/sDii0FzLsEICnNRoaPjuNgEBlxvlPZYQdgYVzegblV2s4+rkna3iQmQG\nu39GYQFlEC6v0ZveFB8w7PM/eYvrFAlDZE72holDzNz6iPRqqxbYBS5m5oDz\nFbYI1/eF2Yv48T8oBvmmgpWUb8eHbTKdvLaJw3vvN05t1EsVW8ZGEgz83zrQ\nf0GV2DhMe3KnzZC2bHKI4RhdY+8ieJLGvpqUn58FvJZBoMyuo4IQC2noV2qX\nNk9GdWow770KfSQ38FBratD2of4RF4fz8Hy/qx6Ur2kKxJHL1Evs6Gys/ZvG\npbXrw706E3xbgO1h1zFbdP1YYuWKPMuYPAy/KapS+rpeSSCjYuy+a4Pzzq/I\nB3WtJilMG9uXmmlSqchhVOVQ22+k1ZL11JvVxCJrzDTed1LlFB9JBtLKufzM\n+aja/ZIM9UVzGKo3fH/UwnN5g/qXqjsMwybcNIidi41BD13FD+v8WIgSNcl7\nTYN0fvu802HPhKffWieRUU4x3pxDXF+C+GP4uYtKDH0TBoA1gbsYBGsAFmYf\nbxj1\r\n=fsOR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnFpFg1UzNc+ZEC2l2eIF9v97X0hod9b3ShHWVwJfWbQIgGtJy0re241G7eJsXGYbtySmsovOqoeoa7Si5lQZSsUg="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.3_1598278892098_0.14597780726887377"},"_hasShrinkwrap":false},"1.1.4-b.0":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.0","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"b64742f26afc7b802fce45a3260ef105370992b8","_id":"react-native-azure-iotcentral-client@1.1.4-b.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-ALVQ6hhUZrGqS1XD27VFOSGLsCB9Lm/ujvXQDLLlTuOdHXKN127bYiPJksMbaGt7OC7ztq5LjBgH5dUexwLY9A==","shasum":"61db3a4b51701e183e20777184ff7ac60a96b27e","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.0.tgz","fileCount":90,"unpackedSize":291809,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSRLpCRA9TVsSAnZWagAAEsQP/1yMwcV0+IBvJtlmq4ei\nWY80eV5n0jUh+zeN+9HoLV05O+v67rJFnJdvGix/w+VZSUugjoru0OPSymCY\nmnUi7ntjN2i9jc00A6JluW0jpDLaz8MD3+4w/ZQnch9urA2LuEzVQ8NtoXpk\n+8mvJmJMatPJq01pyM7vXgo8SPmQkqhmjKAUIlLrVdXNuJPCwA0u7jvb68QT\norg+pFrzQag8aKtw1KOVLU5qOevbxDdRCu8O9AmenMWBJD679kktzK5l+rUY\nH8uVxkKPtGDKX96wNaecDCCoF91RmSi7wejQD2rknjK9Qlzqjfe/qEME8DmM\nbPalaAeycalXJjydu8/KnZZ72YRn5fklLdMdEj/cCL5m4xxw7rqY4fpfhJbs\nBvp71sYKe+yGXwsOLfT9B+1G7+fu+fNpNd2e5XQVLwCa8BSYhiuLStHfoVwC\npIXapdA4r6XJgxaY/KFMnjJ+aYQUoEWwdNj29acDdBteh6dLlhvVSeAhmksI\ni8QvChgpjcDsVQUpxZQo6rtgRS1iZWexv54UwVx6YDE8eteJa6H28qibzbS/\ni5b1qGdaiLHLbTanO/sn9P0cXwhs0+/kMYaTCEijcT9P+qiLPKMsLxrC4M8Q\n5tguBu932mHeGJhlO7H1vq5vMYZWEOLYx0hoWLwkmKjnmwz+afWb/goKA45r\n0yRz\r\n=wgNQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICJ3+RtsWBdUkb8Ru3/mrr808/okzHQHVel78Czd5VXLAiEAzIn86EpHeONl4iQhXQkuV0MZ/2JywPrUI4/evxpDVtA="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.0_1598624489329_0.20904206770203104"},"_hasShrinkwrap":false},"1.1.4":{"name":"react-native-azure-iotcentral-client","version":"1.1.4","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"576ecd5ce5bf0b354de1e89e68a611f5a397d0a7","_id":"react-native-azure-iotcentral-client@1.1.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-EqA2cgPTZiz/KleF58UZ3cAp7BzmoHAUg5XTCRtSHxkh5uKAmIpFXSndIoBlTZ16q9JMuH1x4sa40OEaCYWDwA==","shasum":"a6dc51b792597edece48c375a3e363911654d50b","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4.tgz","fileCount":90,"unpackedSize":291805,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfT69WCRA9TVsSAnZWagAA3xQP/RISd6KPnPYF1MyCue4u\n5/P+Ky/CpR00H5UBVcU+QASi5GM6JTxapRQoFS2eJa3+vS/ruVyB6xNqe+6A\nHEdHn1f7xsbqgNE2/KhP3lgT5yK51qG+nPB/vJjhvDyuqXXd/ySKrsuoTwr8\nW2HGtWzTAdMcptaZ4n9znM6F3qMPd7QdrTB1ZhLzGU4o6NRXujabWN3tNMG7\nuq1wUVHAMYpicO+347zgwgxCnBlLx9gwrbRouBqmnFmSMq7AkH+5xlRqz4cy\nt2a5WTw9qlyg4S/r5fFw1g7wnHVX2JYrLX8jn6otcYBem/iOwXEUIEyn4Hsa\nEzwvhuE/UBSLZEJ2ee7k769Y4flhPmOnwMaN2jB9SFUPUm4PEkv57W89v7H+\nCdPapujwuWBxr/+DGDF8jo4sIj2C5KPDiBMl8ls6Z3oyZm0+ILt2DIE77+qH\ndwSah64NmXkvrpZ9djO85oJJDGlsSdyhykxOinnug7TMxPChJtjFJW9OBx54\nK8DNunPSbKS96vXv47FZ6awIppGWv9OWa3xEfwzLt4JZQebRm+hVPXFIAZMi\novN/FJ0Eu0glVQanOnAtXBGmrv87gSIu2jlJi5JVhfgTo5ZAyIEKfP1Jdn4O\nI3cfseKMcapZ9LGZPAj3NE4ixYxAQ+qEZOv33chjyo46IuPabUhb1rKJ6UT0\nH0vo\r\n=p8K/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPQ8OLGOVpklQZ1qBcsY8NO7noF3QD50UAYFp3gyTpbAIgJrq0E4Gh0ZvQoDqf+DixgKoEawwxt4J6nfjKjFOwRbc="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4_1599057749586_0.5778504172506875"},"_hasShrinkwrap":false},"1.1.4-b.1":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.1","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"03acac01dbc21831cdc8c63c0a42941e06ee0dcb","_id":"react-native-azure-iotcentral-client@1.1.4-b.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-a5ZKzYNEO8JclsxfUqb0SEntahpTao6CmTfzYZ2uzLu9y1a9AZgOQ+fxP8mXVNuhl8Q39gmAGha+1OKr7zm9MA==","shasum":"2cec676a12fc036b9db73b9a29b315addd082c00","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.1.tgz","fileCount":90,"unpackedSize":298980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfULVECRA9TVsSAnZWagAAtc4QAKBcK/3iIze2xLjQDwAK\n/MEzqw9dfB0XIaLFUsYULXuDKhsOABfMbVW7okWd9zGfX2WTRTDyu5RzwkrX\nM+ZpgsUWoHmKnCTDr0P1RpFyVcytIh2RCRsBk0+OtXdV6ogPCXA1ePGWfd3i\nKBX91Unnzw9cMOx4ODMsF9sKKhZp9Ep738B6GvBEnqeHqIpWP2WQDHPTv6pM\n7kIn5ukLjPgSh0fo+M5dK+wekOec7Hc1/J6KH7b44mzEx48mbSgpkneeTIaP\nVvWg2jwt0x2mO71LyaPaU7tACUcPVAiAYKR5ARfGM4JZTs1FVO2yts6spmd0\nf8w5PLkH6Yxb8sYzvxUqV17+QfFUjD3MTDojUY6VGpKEBZ7nQVJsVCz7MYfg\nSQdf152Kfbov3CzOgeGqa8CuxrIE0TXQisdRlBlSeDuIErIqzTcZ///mNUHY\nR7Mff4dXKVhrAFCbYz/pact3WQ8J7ojuJuEF4yBHjxUJT10IIteFVYws7YSp\nB6ltVNUv45RDsnt9nI4wIebvH7sEPx2gdiozKHLx4Ipb2aN67DWBG2GBXjHJ\ntHjpexLyhSME5q8u3ajBQrn45Z+iR3RMuvEzatccngee1oEOCMvslulymAUI\naNRo/aJDePFbWq/2pQg2XRH/7wzxE/bLFoq82qzxZmbJtWxLm/TJPYJmC+BJ\n+Qms\r\n=87CB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEqY0dRBo0s/FHjE/QNBZYnqt0kRB1JEjteQBGzBdFwYAiEAqKHovdOvl69bsLzDgXBU4Ove+cV3whdD+4N3aH7Msts="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.1_1599124804417_0.12468900157644369"},"_hasShrinkwrap":false},"1.1.4-b.2":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.2","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"705337a08ed8f6b7781ea7de06bf622470bf9544","_id":"react-native-azure-iotcentral-client@1.1.4-b.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-cRmm9EXGFyhkIC+CdN8AsMak1ARpofsqGD7+IStHry+PFbeSvkfhTqPCihsolmYp6TJIF820l/7jxi57u3E/dg==","shasum":"306da6f05b41249fe3d32c16f79b05e7c70548a9","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.2.tgz","fileCount":90,"unpackedSize":299536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUMNFCRA9TVsSAnZWagAAZSQP/3q6lEaq3lABv1AFFsH+\nUnRwgdkVfqhb/mDgu7sfWyOWv+LaMnBKHzk62SvjJtAauJkmb33QoOnLeAGH\nFpV6cYnDOvuadCRDFZichvUMmBCKnW+mm8uFaa6RtwJBVpJMdmUxE4a9d4gF\nDagW/SWLtcYy4PVmVQ8TLM5EHtMMy9Whs1BOOKUaTaBPDcBS+DKgcR8HXIK6\nh0FcE8RAexWGKW2IsOc+mP0n2p/If1f0fNALungtwKh0dF5DHnjYg0vh5ls1\nqPW7vUPbMMzD/BncWK/BdYLd59w16JGWG7Ms222urKzQ8xGgzgoyDEZzWMx3\n4uY+sIFMNfYNsvu+UkpQ7K1hW5thvVRkuOoTTkPdXCnN1sCye3Qh+yRiJuhc\nJYk7mUcSl0iWo6U3moqmZhG29wjgnDCVA0XK7XeiEmm9G62WuvcUWF2VUeQT\nBpfstD3QzTnEc2dDQP8Yu0pvZf1kiEMR5ZluG+RoOLVakJpPGZlpiKxPm6b5\nUAxoyiyZSEDMs79Z2/IA2xnmQe747kvglqwZLtam/piI9El54x1iGlEJjdmh\nZofj5IMdIfjgxd3xBnCC5eZwZun+pKg84rKs8yW8+7G2SCztrtRcBgCb2HFT\nwqpKIpZgSmFXLn0FRbaWAlPGcRGz4ShaNk40lSXdsGbRIj93UDf1jmvYcadV\n8+PQ\r\n=7xgq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF9cBZUAud5O4NTItB/3K/rjYynGoMc4B7MbTCvhvo2/AiAwDAiuYObsISoJxTH3/sWG/PqYHWdsvEvMPwEj8XLRaQ=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.2_1599128388908_0.5474095213748804"},"_hasShrinkwrap":false},"1.1.4-b.3":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.3","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"13af12d2f00ace5c934aabfafb688879690705a9","_id":"react-native-azure-iotcentral-client@1.1.4-b.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-TNayTN3caI2C5S6/Pk8ajszndpxhuSrmOFlqd2t9gyWJW1oEZxTGVnQHNoNOWMkNMjN1ij0dNBO/Hlj7BsrOlg==","shasum":"91a714c57e95f3f20adcf56d2a0bbeaaa3e064ab","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.3.tgz","fileCount":90,"unpackedSize":302379,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUP+CCRA9TVsSAnZWagAAzg8QAIw5H6lEq9xPDC0ZqdCU\n58yT2tpSBHojcDLwEGAXjD5b1zrcBZkq4j7SOu7daoT/2mkiv7KzDARASlDc\ngdxdSpc64DRTlAUiMct4xGKAIebcsGQ7E3SbmkalAyx7FQQS9t1+Y5e0sgoT\nWC06n0rmDdWf436ahivhiyan0eMcsW+6HuaqU6YPemsga7bR5AWPr0ybv1KC\nobMKxWnVXh62OnTaydmv/DXmWYZdP5nwmqN48+VG2mjP27U83nrenNYR+TyG\nDtvPWzD7KMFhfam47hR/bWj9afFuF/BIprvLwq2aqjZZYZfJkPrBjNxR8EoQ\nJaXvTdk4udHaXp+1cipL3fmYRUEh+l+1Ic5TU5rUqMGTVC8uNmu40MlH4uFT\ndQ5dBbsUlawavfaHHi+CRDNctoH1jHWxWDzUX/oNIRB6BUb8GVcdteyEB/f5\nbpbm7ZQoxDnPHpsJZqGnwuXk8iYR6HmGVuu4e0mghaXkOLlO8CQLYm5u2PZ/\nSIUS3m6arerSygJb/hzlUYaQpkOwVly9aB+jQK4wfYSkw86Ikb6LXlD8Epyg\nm6rXKTO1J5z45de6T+vCbRi1yLv2I+icWJRVaIvfn9hE56lR/iCFKEz5ksy/\nUOq5C5S4GaZ98UpPwjkBA9oSkmgeQJ7cT13oqRuK5VNnSk/V69uKUicrWARE\ncUA4\r\n=FCUe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+YLfwlnQ+luhR2eoP3iuTQcW598UuqDC9KdtalSlBbwIgciF1/dts99LGHqQcyeWoNA/eSwi27X0UtlSswh/7Zuw="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.3_1599143808993_0.9174230847475398"},"_hasShrinkwrap":false},"1.1.4-b.4":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.4","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"92237aa2da0938dde9a239c219c1ff567798a88d","_id":"react-native-azure-iotcentral-client@1.1.4-b.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-hsrZO9LI3WWNyEZIHNVn4Cp3B3nLiZ7U5QTxlSw7ZoS7zI9wu8YBT8yZKpBY2Bfhz+ZJsaDMgEwsUW71jAwSjg==","shasum":"6d80151166c89e3a7b0f9dce8076e67408d84e09","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.4.tgz","fileCount":90,"unpackedSize":302585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfUQBBCRA9TVsSAnZWagAAPa4P/j7hAY7e88GWi1VxkeAU\nKw4f0YmNUOt7WCVGevfRvka/e51C1Mrd9zd4KB5NBIdU/Ne9pVvRt3RZJTak\nxpxevjJ6mZpsoCqgZpXBmCy2bdOeS5gi3GQtuc5zuvX2VIUYhmm0B99ONcMa\nzzz8a5dU7w5n1REMxKjq68Rko903qUGjJWJTIlzg8TfO6qGrF+Sx3y/+j6Ww\no8FkWDlEAa1M+kLOrCHOctSKsVKgVDhHBHoxPGZ1CfKSqVxtXLQfD/uTdmex\nOLOzukxaWecfIm2i1yB86U3X3hBpdhrOs2k4lAvkndBt1eBn3wi/Fdu/2aqu\n624AsiPWc+0j3t13Gh8uyvYlY9z4yvgDSuS8RJs+mP6CARG90gGGHr+YYjig\n+MTJTRqTjXJIJdRrstHy249EZV34aByltk/iINXkTMvpSPHMR3ivhN/JJjmq\n6eIktILiaW0V/k9Aw9D978TCsZILFQ2GbRK1VBzeMkRdOt2jj9nahS8tI2/M\nMksPu99g6KKmGWdIFs5pvqgHM6h3SXcyT4kHWIlPbaEN8zJ7X/Wqg2V7uLXP\nmMrOOHeFX6sZJkJZ9m1HDiE9Bza7TPa8yPifdNstJSyCFlJdNlLqSIF5ByHJ\nvWgHGXHFLcGM3iFxsbyECBCTK6B/xK1Vexdm+McPDlhSVZsqD45MGv9MF6sR\n2jdb\r\n=5TMW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFH6httg87babdeb9A4+VSshx078W4BwoOisScMbtPjAiBkBkvruNNuuOXrK4CGDHzgoK+agrfMmsC1cZqQmt2xfw=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.4_1599144001162_0.6181587391210996"},"_hasShrinkwrap":false},"1.1.4-b.5":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.5","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"8b832b9173c4f29f5aba060d564b0e1cf7418c01","_id":"react-native-azure-iotcentral-client@1.1.4-b.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-XX53czNd+ObAutv1wYtlCBCniq+oPIDS82N/RuwyM0m+Z4wnfMn5V8YOAKdPDkfGT87kSIzvbgIs2QaFeAC5iA==","shasum":"5612cb0a11a7b3849c57f62e109aaaa159243745","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.5.tgz","fileCount":90,"unpackedSize":302657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfYIO1CRA9TVsSAnZWagAAEnYP+QGkFESM02/KVIlx1BIS\nhMwacSnIfxuAIVHQ4SU8CVGCjJuILoyAVwTXT2O7lTdYYjwYBZceqWQiUW5A\nIBMNdgxN2okMiuCcOYQjB3czmav8iv38A9tneUaBOcaXlZHevtqOF0n25BjW\npIKSPzaBbV/plQop7g27dkApro0jz5ZHCtcA3TF6LG1x19nZKstEHzdmBjJG\nJkqpc64Wo4/2YoE3uLJsGYwvwRp3SSVEE+tbMhzOuVqalbk/jVjaQgnm6lbM\nGPEkY5UBZ+m/Plq7tK0PEq2wGNA/RLuNmtzjOWHam+zQJoqtzT/qZrcojYSc\nCnDuG4IXBkCkOFjes3wSGiSKCD/NpohFMR2x1WZsI0trHDsGs7VpwKI6qeQD\nxe7nBzDlGK5KYi0MBsLZQYZ8Xi+2t8J7HCf1pQ4E6UPO0l1H0JjJPIB2GIeT\njqNh5IHZeeJAlVzUP1re6CIddWyRJh76mMuXIB0/owix3ZcUMrhNKsvDpUA6\n/0zKhESdl7ex1+QES4opfuun53RtYpLGwMVPu4k4NW2Xmy5CQhplmgsatGC9\nn1EEIh4koQhVYbi5zaqQSAalDfMKC9gx4uR6JCWC2SdYG9WALOyi5wtdPwLu\nZG9N/FOpAYF0kxgYbkOZFRZdjSkatMtN3CM84wEuzZlTBlnbJLGy608t618F\nd5SX\r\n=+wBV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgafpQ+f18ZUAbV0z3Jaww+UsQAa+5bSkFP4N9XLlHAQIgIuPrFjXxNzUzTatHpn5CryyNZnd6Sz/sUEXVtesnpZc="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.5_1600160693282_0.26810785999693953"},"_hasShrinkwrap":false},"1.1.4-b.6":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.6","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"310a3d00eae3b73b473d0fe1ef0dbaf1de84e680","_id":"react-native-azure-iotcentral-client@1.1.4-b.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-B0V4tJniCTxDZP/Do7HNNNgl8cUF0uVxLco2UsYYKrMfWT55yS7YXN0MKbAoPq6vrYjMrEVhFbM5z7biGX+w1w==","shasum":"85a3d9074b31e648fdb3dd75507d5f3fc39ae32b","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.6.tgz","fileCount":90,"unpackedSize":306304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfchYUCRA9TVsSAnZWagAA05sP/1fZ0iOGNfIWbcqGCsHn\nEbbdbqgSU633kH1YN5Gql2+3vjlZdSAXLupmNtXrxBRUC5IX/02uq6O6Uq1g\np5w+szu+zBUjyNWfGDpfRytf2JrZXTbXw1G18p6kqLJDoVykVKdq0497cZ8x\nGQakf7/I3jf1BSkI0uPUkcYTpzFKBVMeXIJD7ecepMTDPM/9iG8KGKlC7B8k\nbAiKWBMjycI4DT6Jc1RlUNmKLGfke8Q6RL+RqWnNfhr49JqMXjPY2E5FuupF\npzISm/W+83XcoQaUBrmIeVQ8UBpSkQPn05vlpqsaxyx0+W7mUQDfY+iuHrdx\nBxdQ910YmaABSkPMxXN5viJR0Cg8pbYJcLEnAQ66YJQSnjYArLSZwV1ezXdq\nTPqIENYdaXatOqRCnWVagEtQUrLiaiMt3/5lb07n1SxzQ/10K3sLuwUfyrjs\nyuKfzhun/ChbsATF7xpoxLZtEkCWpWsgzMq1u8bhhCj3k9YHPHW6Z2Z2pF5O\nruG0gA3JhYVH/QONYljQx1be9A6gBBHeMK0Z24YmcB3ZpbXLRbEU1pgsEeVD\nPUpOhTisuD+WjWXF5XcwnJS6hV7cs8myR/yGsGl4U8L4L+MuDyXDs3wwsaoZ\nxZb1qAXIH75YqQprlc8joMe1L1R6qIYqiLmdAb98OWDS1SLufma4cGs2t669\na8C9\r\n=Vnvd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw9m0ejfvhK2PNV7D+XpbFXDQ+X/mgNvE+K87P1imZoAIgWGAU6lLITCqzH5PzLw/DaZT5gui6tI99SLZSQqaCOVE="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.6_1601312275871_0.7708755382837598"},"_hasShrinkwrap":false},"1.1.4-b.7":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.7","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"94bc03edd477218cff3608bcba4b6a6c14b55bf7","_id":"react-native-azure-iotcentral-client@1.1.4-b.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-e7DALHLUNsBOq7OanxDpuzla2gcWdmGWP4YGBbK2wUXDvbNQ3pK0JUsLtrdrvc6/31kUfaVSkjzI0QhDvbuvDA==","shasum":"76c3ebd2c0cda06da4140b6d2407c0476175f296","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.7.tgz","fileCount":90,"unpackedSize":307143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfciGiCRA9TVsSAnZWagAA5eUQAKTSpEhle5t+wwwJ6/l3\nxCrsIbMApFXyiXz9zoOqATDdTXMqfwYYz4LSnmg3Vyyd8TqDpu7ykggFVtYV\nJ1XHPZpJn0q8t5zgcumq0v1MhWdQJpT9QVShOs6nLtGvUTV+2OI+RDWVVKBO\nzWJCdBPwMWHioyf3F2wj2K1jMVWXSoXaQCyi0fg/nt9HBEaBHXB1CRw0y3Ue\nN3TpFXRRDNyUOI8+7vFT/ZEXTZ3SwSq3Rh9DoHj4Dt0rKpZLEdEVlgfyVVbP\nQa6ttJnhGB4uR7/UBH/ihP4YPkwf/Y3ULWxEp9hc0EwEBgnERtN/vnBiqWsP\naBOM5htu4sZJIDydDwRogO8t+NAcS3HpMwtElECuVRNPIS0nF6+ViWsDuRRn\nOfqXwjVv3wVzesbFn8dBsBEDM/OPNCWTKAKml+feJmsyvOOmBNTBSBIG7X3u\n5uxVD7Ps/DKVJPpAf3rbQuiOpXA0G8k6Wm5UQCf603BnuIuswHef/LqcFOph\nvKFiwbJXOdLciGSGqM/lfk70IfBxhLe5OsbD+XQQ/RRcO3t5ROeLL/ALvTr9\noOXufcgStaJniXsPkYbmoM4uWC41bN18eeaFiojBhhODbj7DlW3GA2c1Nh9q\nBsWfuCWxgc/OGdPo5hHrevnshEhAsN916k1brsayyTODhMUTxHN9aYYYCG5j\nAXb/\r\n=d/rF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFh4+P6IGynct5vQVVnPpxsc3r0gR90tMdi/7Rz6bupwAiEA+fDgOe02JiqodEyzpsDvBDMKeHju+IhiVsz493ag3SA="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.7_1601315233849_0.390744919275233"},"_hasShrinkwrap":false},"1.1.4-b.8":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.8","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"15e9144b33748b7ff49fdffdc750f92ae6f7c565","_id":"react-native-azure-iotcentral-client@1.1.4-b.8","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-Gt8pqUwl47YsEmxQ0v8JxFkeOIFDwqhLxmxcszpeIJF/MG7+t/c00a/oixFjtwad/vrWdtnHrKm6NUpU816RKg==","shasum":"b533558ca72c6bf954efbd94483d9ab6e99aa2b2","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.8.tgz","fileCount":90,"unpackedSize":307327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfciLICRA9TVsSAnZWagAA9t4P/jOvm5UhiAVyUQBM5CPt\ns99HR7215lPvOpc4P1V4hakRNHd/PJHIm85G1n8Omts9XAHGwX/Fhd/ywzz7\nLlwfziMlU+MeK8bCJoQfSROKeYD/ugNgbgHA7caNW47EkRHKOWmkBm6bcr+z\nSrLGXRvpTulA911ixvAyil0UD+kYRd0OafPzu/YOgDJ4LWfPyfz+2tVRtcDC\nvenWYI/OQWsyxtvTaYCxQR4/N4vL2FmdhK5/4GCZ4tejAD1lUdhvIzwK0KCk\ndAChd6HAQQpENsxA1v1ENoy+0PuyjBxyr3S733VfEhF2WN0QLBhWAqezBV3P\nnPOeCEQ1Qfeglk2ZpkPzYYoO6lg+tNCq/mWaKxM9xKrh8tAWgE+qhdMkSQ9g\nMEgf95ilD4Qbdvn9wClLXg8C4QHhWENuMp1zFctsWA5Zu8ImQqgduTs249RH\npGbdKuVb2EfCHuPf6+iOPcGBdtGD5Bl1RbuJD6QP8rANs1BYTdUD/nIu2yjM\nnoZTEr2iEB8pL6Yq+J3I6bmnY/QuEsXS0w3l54sb+fxMqUPAnV5bGA8dveqe\nvADrbaXpwcs1uZEyJQGrRpOTHTNGGmhluUFzNmladfXjD1A+DpP7xBGV5DWE\nRF6TxCS2L11C7KWTeXBCeNYjEsbpKF10PtlI85hWYNfjjgXo3uvzFAFOLMbX\nBdJ/\r\n=64JV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkDUdn9q+VeFm+h5rtDetw5ALj11/EP99awo4CP/baXwIhAJ6/u7C9XU5wYTgYmuE//M5rXbl6HB5whJalXO/UrFkm"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.8_1601315527692_0.449579886428515"},"_hasShrinkwrap":false},"1.1.4-b.9":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.9","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"932d0988f322c1c0547aece42be41bfb86be4e17","_id":"react-native-azure-iotcentral-client@1.1.4-b.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-YZ77CODCnTH5i6017XiLu1khqV0YvLJi4xd34ymjKyjPLDsh8n1Pm0YUUmTHevnGzmrGiUwGxZ3GqCKY0cs7Xw==","shasum":"76dbb1eb09ba7a75ddcbf27b26f81c3c852c6dfc","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.9.tgz","fileCount":90,"unpackedSize":308534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfciSuCRA9TVsSAnZWagAAI9cQAKF2FnThomoMY8oJDRei\n4CXedwJ26Ui12syq5/+EayBvMgP69FCGhtUCGI7FnJhjPn3CnyFGGIe7Gh8d\nVJbFEu0jydn9fTqzbVvAEdU/ChlJm7jwbeQ//nX7RRNO8JTpRQw9MoSKYfi+\nMQY6pYMQHrApYieD7XGShVsRf36tarBo50uvRSB7KwPk2yihSbT9q8J0sUo3\ne5A3I5Dm/nbjbsXKbKYTkM/ZrNnJtT7BpNsAfXz/F6Zik/4C02Xb5hedPRYO\nK0fY8ub7fpLizIrdjReylmzMcuRTC792+eiNZgdXvrY1IRIAsbKci+P7tGRy\n2Gfafgtlv5ljkn+crQg94QU6u6P4fLatN2YUMnFyrqUvXF1tdiZBURTA5PSu\nJMeiEQgNR8dTqE5JiH5wg56KeKjnalPlJvShmyvWvdMcTtYxDO5+o0LC8s7C\n9MWtspVzTCZJsddKPrtpE2leQ3K3sDLVFwCK2U8hqWc+GE4IfZ3A3hOe1/qN\nPMcgvjqID11RgPUdoJ+xmJ3ARcEZBV6C6GynYit4GW6AusIYlfCG7e5AmMN6\n7zWLzbKc3O6dTWZpCJkfrGaz4saZX7+tvwK3WKBPyp3LiCz2s9OV99v28vaB\n14gVogFLCZTEwW/jXeBckv5pwAMhsbuK9guwXe/3YlDfluzwUrwgKRQQNs3s\nUUbA\r\n=pqpd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFZ10nFrAztFcEL9uvXA7RW8N8ifJO5TSe/ooPcvLE22AiEA1UJOEhO8z06ZQcmiqrnZP6V/+246WzGUt5vDf9PDC+M="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.9_1601316013816_0.09155136412730336"},"_hasShrinkwrap":false},"1.1.4-b.10":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.10","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"aff1e5e4929406b740277b463b0457ee83c775bf","_id":"react-native-azure-iotcentral-client@1.1.4-b.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-dm7FMFwuou6aYuo4M+tgE4ytoQnJocOYn9LFKYp7JYJecaNP/1Q+8mgtRqPasl3MT6S378ZzG+ADlB/eisN/EA==","shasum":"c52c58e1cc8710f3200ffdbca7bf5ab49416b778","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.10.tgz","fileCount":90,"unpackedSize":309320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc0xACRA9TVsSAnZWagAAKLgP/2ZmXrJrYJd8Ix+lBH8B\n1zvE5umIHrmB+m4HO/RLTmdgAZ/zsCttPSuVB7OGg8NVj1+JHIypZopVND83\n6MNlvdoPvg3373Qg5S2ZU3XkcVDf+JjTfEsqdAZFbZ9WXSUTQM2TucuAABhT\nyP8Pr3yvwuOGzr3l1igijbkrbLxw3WpM80sRJ66BERn/edwr/paPJOFkmJVL\nBUZ43D5+1F6lAwUTyhMwmhTnfC1MEvOkM5kVbDvBNpNpS2WUZGbVd8075zq0\nESQ4xrPfbTnbGQsXHuqKTvHPYkQeN1XhXj5Z5dMK/SV/zNqDtHtQOMvytCPf\nWDpVaImBMGl4KJqF3gNlxCe+V9JC5wgJP8g5m8JnUucaCI6N20x71mKc1TyQ\n+6Htvp+ljGWcJi6ENIu5qh1Wf7VzASRuqGP/KEN6zw8cLWuPkvXhTufHVpyL\nzm5hiqWtJS/lzUswTIjhSr4lJioQnFDMfY4+KR/GJQ/FEzAsvlfnOb/GikWj\nA8QuvGSs98wBfMRbYDz9m/5yqZ5aIT5cU7gzD5lcUJZs+SbA1+zKFFsgDmW+\nkzOUiJPT5wS063Pk5xIDEu0cbo+Qx0wlvftv6XdgRPsydHE6sjKyOSFpLnT9\n0BPU/DCyUOXnv872GKeH/GW9DO9harCXfo24jc016SQ+RVt/wop83B0QFVkJ\nkEm0\r\n=8H4J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHny10hpyfDZFIFd0mNe1fTTVNVph68M/rqdYUvUVVNGAiBb3cZMH6C3WikR2qUOihEtV91Yc9WLZhbFfiRPsbS+Tg=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.10_1601391679865_0.6832291572322682"},"_hasShrinkwrap":false},"1.1.4-b.11":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.11","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"4e57d05072405916e9599541e4dec607d2407ad5","_id":"react-native-azure-iotcentral-client@1.1.4-b.11","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-Rl6kugWrTZVJTZTwIarYWS6n4bwyRyGzl0gCifUrwIrmJyzlEsAppPUDDX4F6JMB9B1VvAoPOWud1973Gjargw==","shasum":"6688e2bd3cfe1499701d43b9e310ce282a1e3c32","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.11.tgz","fileCount":90,"unpackedSize":309222,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc6oWCRA9TVsSAnZWagAAaegP/3rDM4fsOL4V8uJ/B514\nnEXZqqj7fFYD55yURdlm4hBsRMZelAc/gvJtNGfK6hkNQ2iBudNUVPpLwnju\n6vDi0GtnVAkcaP1nPTP81tNB9lOQtIZcaVUyntUMRv5mCUnWbtdzK//mFe2o\n3nH2rT+1WHKN+OLc/vyjIDdALrQ4DeEexwHLvCMuK7Gk9bHbszMSJmarj4zT\n8pXd+WQ52fh0mbO0y2yvI4UeKuZVxv/yFCUAa5BGj1LL/F90k9R/9dj8ohnC\nhNvIui5LbltLVyoSdddoaDx5u5PYoDirbGPzo/5zhoR18a9Mhl36zU/hsLru\nslsdYj80/TuQs77l/NPF8zb7X9LWnpvXOhuwcrdp7HNHBluj5BeE/hXQ9E2s\nhlve818AyAnlB6FWYdnVWq5E60BWJ+NPYHo8h1WNsIa50KHFTOLEpXv4aNuZ\nJYJczpIAACa4ZGwHoRgvbQt2vpB1Rk0PBEszZOzMAhMGgnTne8g4K0sGcfNE\nniJxVMD4OLpWke2lJInoOCUMyNeTvSnyKxYwH2INA0WDS4+CE7aITfUVPecz\n3xjm7QImTO8ys1u05+axkZQsTzAZefR1/pv4c0bWIRZynT7VvwWcIOKehcMF\nuGGDA/kXVyoNLNCcPSCiC9b3d9MvStX8W7/9myZcNGnFY6i37RQh4YAFFOu7\n8+0g\r\n=Zb/+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+P11+eD24zdNltOGFrP9df3J6vg5+k7qu6aWeRSVx6AiEAsCkChIDb9cZnvZTCdwmoj8mVk2Gmn3MRo9+PY0CL3lI="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.11_1601415701409_0.2028232268905752"},"_hasShrinkwrap":false},"1.1.4-b.12":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.12","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"8f8a798dc51e5e93bc2fbb0d3b8251d6cfba2363","_id":"react-native-azure-iotcentral-client@1.1.4-b.12","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-bDvlIJu1wjYrwD21WawwhGaYefnFc0WAOC2Q0GnlzJRfpG3ym+MAi8Qd6SOubj22BCDsIFm5gd5eS4RjS0jyBw==","shasum":"d871404b95bef2aa18d460be863b5998f631c091","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.12.tgz","fileCount":94,"unpackedSize":314038,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdFvwCRA9TVsSAnZWagAACXwP/1QTY5JDC7qeOfh3+AzM\ndT/CGxeMvSuNR2p7YjtuYI5E7d/jDowV5KBegy78myGCqM051bWOiIjDsSpi\n/kDEIA403NpNB9ONK9BmZNJ3EziNvqIavhGiO/3gJRxZEz/jaW7xORENyYbd\nQAcKEKQsLyyysI04TVafZ4HYAuSMWX/xUofBtx/UtrvZHyOq4nmSx1zB2rK3\nPHhk6QYIXmtOAyCeX1UiAu19QJwcqfoEMNUk/UcGUrcj5PHDDYAETufXZaq+\nZ51vobXpvazOLK5FdNsExSXQDydIMcLHZ9XBWFlwdlq2HaOqx1FnX+L9ATmC\nLJqOdZ5LsG4x3AY8vhSxbKeYp8kxK6AlFOfUJzpPhu50bhdAZB+njXMY87Bp\n4uTy2IsRqUE1oZuS0uhIKSM9gGrfhHqZMf43Pp+gtyMdUQUB87LJqrLJ02rB\nIRm0vqrd9i70bkaCDJpdLdG0AyjS42Vh5C6QggoTfoxRRVwWPI+7iCP4Eepy\nl+nSRxncTqBVE3e4UtrKpR89kjqAkYSaRYndgtLB5+gcgL8gZ/ItYMMm4p1+\nL0yEpK3zYZ6kvsYa75sKhaR17bagXoka1UVsnQFWwfxr0mV1eGDWzKYo7jy5\nKwo1lpbyurhepEKVN3pvsX2j4Bh75TANmBGYf/XR0HWlV9ElY0ATDhG5BLqm\nmZMW\r\n=u+cb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDruqBz1rmkG3kRQeYGDA5iDm9iF9k9vFikpx7cJltNiAiEA0zK4Re2JxNGEKOIB26/ZdS2ntd3izgse/x1Axk8VmTg="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.12_1601461231678_0.7758430391115192"},"_hasShrinkwrap":false},"1.1.4-b.13":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.13","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"bdf00cf109b3eb00f6b459b55ba8681932bb30cc","_id":"react-native-azure-iotcentral-client@1.1.4-b.13","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-1UmyFk3/IKsQY/4TDhUopogY03M2tmTqAV7BvpWm0GKpgwKL22V8eaJiHBch7o7VTJMsbviGjIKA9HwPfa2rXg==","shasum":"846ec456186b6596432e666fa5ebbb4ee00b4270","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.13.tgz","fileCount":94,"unpackedSize":314203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdF2KCRA9TVsSAnZWagAADUwP/2UwPAfr+QM/RvScB/gT\n6loVkEgBJ4tm9k6TXOkkqfgkt9+SN4ZKW9AeDTynUyC2VUqMcs02hUTflxot\nu2KmQkQdakyQfOoP1LCVJm+eLTnbY1IfiTlguvZo9735nMR80WWrUaDgB2x2\nMsSgRpNO315Z5IsMhL7PliVhR9iKBRozRIZ81yl/PeuBDoDcey48H/U6Bdyt\nR4536TKTnSHPAb1/BkbR2sGKa4m5b3FyHJibcAvuI7kJ2TC/FnsC7ljh2rri\n9mcDHI+Su+p6coFxl1PoZC6gv6t67piGRFReZko9Euxd80Nl4sRAAdG3A0ek\nogrfMC+DG6hzM9vl4vMN0GUThByfayaJhgE9dsCdQ9TYZoH+KlWJ6IhtAFWp\nbi6NFgvljC00j0IIPLyXt4IpWufauwxxKk+6NiAAWKf5Eh86YHHrAqo2rOcn\nDYsJulonlPtDzLlTui66spU8rEPu9avb//y15d65LdfyptX1ypmpQj1SdFsY\n7eHUqL5YokqelLsDA8WY17YHdcQjaa0J0PuNKOxHBPE8WMg1HVTxaWlWcDj5\nuzk5yMfHBZSFl3LyXOHxjXh3+6oqAITYOyNIhaEGJFuYuT5cRqtxG+JuPwjQ\njpN2v8/LWiIk/25JXDVdz5rY+7sYUbhT1oIoR+LyHm6TswlfKQklwelDM5Oi\njj9+\r\n=yuHy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4sloyPpSuS0mkRW6VE/WVeAt2aP4xB5gzjZnUAAn/5AiEA4YZNyv13h6U6/a+j4Asmt037+FTBg+jbZT+09XGVhmI="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.13_1601461641575_0.6334392687712951"},"_hasShrinkwrap":false},"1.1.4-b.14":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.14","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"dccf64e3b361678d37dbd5fe6878842fcda61a18","_id":"react-native-azure-iotcentral-client@1.1.4-b.14","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-PnSNLUONGIOYF/4N13vFdv9xqG8QmgqKetPSQkRshXCn8NZxZCm2pWMS6vnlsawIXr1d18oy3V9IT3ubIv5iDA==","shasum":"561e19e5e39d76a4d74b8ad621ff9c9e53e12e10","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.14.tgz","fileCount":94,"unpackedSize":314262,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdGCKCRA9TVsSAnZWagAAnGcQAIBWRYZ9Fake+vQhdjHh\nKfOs+AXQkmKw5wIjEIYbr3MpheIDK2Az6pquDzFP+EvJ8IJFXGwe+L4COBgs\nF4d72exB4WQUEpYKUPlyvqLwSxOoH/5SWGIqmkzoJw5hmdq/vQ7m0zskoSs8\nXgqPPgDiiVm8ZCFNri1/HiIkGpHe0p7A1NUvancmJYfnBvJ+JX0+JoyLdC4A\n5CnSqnQMVYP7Ye+6i7N6wD0hEJ1Edv+mbDKFt4SOUBc2JtH2Qjob22ZHFw+X\nd/wsVpfzh8L281dtQyqCw+RCVr8pCwaErSmY8LUPDhqoU9l4F/lzDS8hZx3W\nMeBLhWIWH8hizfl0Gt4pypA1uxsL4kz/aJ6vLhDcRjnPoNCdYSxqkBmqrYN+\nPhEvMCyxm5bUi0qttlG/QK+bPcvc9J/iCmFervxkLBER365xXjwP/OriG+se\n18AqtnTrhRF0Zp04avT7sD5gQExE34jfVe7QthJmOp6yhOf/VvEcsPao5Wl/\nO72qRaxE47KcRUPueN33gZRNmjeDZvpq3hMHCFOO2UZl+mYEMgjD7rqTDmyB\nDgseT4bRHuuojEzcAoCUR+TJ+0VE5oFKYVxEij4iSeniWfGva3/CNpNIM1uy\nII9SbHgEfFlXja1cQZIW5UEkKLLrHuJOGKrtjzJ9EQ0EDT6uim0pzSSrpmA1\nY/PZ\r\n=ggxo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVWRWVXfyrlXtGMGWtW4XyZNRsvDLVqIX6DyF5dnDKKwIhANXbEvwdVvn2B+K8rP7P0+yoro9XPm0croqc7OkPJ0Hk"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.14_1601462409633_0.8492624082256981"},"_hasShrinkwrap":false},"1.1.4-b.15":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.15","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"0604607fc2cfa9ba610387658f8e8b8c128d37a6","_id":"react-native-azure-iotcentral-client@1.1.4-b.15","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-9ag5mGXZc0qQXefsNXxWFANyPXcyTCg4IU8GNUsKLBWFeSRoTrqclVx9IdLInNgpN9DFcDgfWQK8E5jpm8NAkg==","shasum":"06f6b71cc3b3a4c3802ad55d9c439cc48f9bed0b","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.15.tgz","fileCount":94,"unpackedSize":314315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdGE8CRA9TVsSAnZWagAAGwMQAJ6RolqBEUSIaQk4W2Zz\nY0Y4Bu5JYXtyz3EskFSmxbO/3TYZU24VOfdONocKK9qECPMD2r9djb/8kOVk\nZtC/FMmPrh529Udy6aaEN5tnn+mZPc5fpgPrZTTkvVggZTRPwiKe2sufDeJU\nYFvPaT8DxId97WqD2hLDwxQ+itbbutvMoNDSRWPGdmW5N/OmgfpiESFAzKqu\nWhepQjkBwHQ3/Oop5ZfQiEzIJIqeOPSKUGr7SZZKWPIV6vtVTb46slTXyP/B\nuhMyKyvEznMpHSz0peFPshnQFgBbF/voCCRFsPec3B2fYDxPJUODM+o7XlFv\nV0woDi8V6LWLlO9/mEqZqyYXlltuJgR0S26zbJN8jdeNN6hG/qv3o/7nfjEi\nJ7YAtG19udp/Gl1CbeUdEdYoH5GY6MDIbFZvLtm/WQHYixxrTVown8szz3wF\neyX1tc1NHXAzG+atk/BjDv5WOIlrEjP6uAR9UPYD0iuETr0dUBt+ppJar9+m\nLr/GXv2/K4AmU09yDMJ5TD85Je92eN8uj++LEQyvPPD/FJzYDvIs9GmeRoya\nl/2X9BeBpXXXuoUZ9PHHjRnZBQ8hfKNeDaC1cOoQfyqYgSohsYbQ1BnMZboQ\nKquvNdRDPnJworpNabDr4jLZ4amPn78OpukyKlsCLZW2baA+eteZ7N+oXcb2\n1wiS\r\n=dxCF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZXDLp8/PLKkli9010JnoiBM5VQH6ESekyFkouYWnlhwIhAPGnxXUVT2Rs7Wz5MNrTRUqH6cSFsYQG+CyLdqfv1PRM"}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.15_1601462588434_0.45699357654594186"},"_hasShrinkwrap":false},"1.1.4-b.16":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.16","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"89abeea6577d181a907dc9929673d2193f1f4c43","_id":"react-native-azure-iotcentral-client@1.1.4-b.16","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-IbQaXhaBEth9JNnPbKl9CzId0XQjtP0DVORYD0KvC4BlkC3T3wcLG0WEsyVsbHHawlVc/Ud3EHSfE8W4vF736w==","shasum":"1fdd91893e5e72c6f1ec91df8cf49abf713226a3","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.16.tgz","fileCount":94,"unpackedSize":312315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdJlkCRA9TVsSAnZWagAAV8sP/3x+G/wcEVJ+KNe5yQnA\nOpXKm9XwX49uTWLDkbQ5eOTHo7KVlFnW9s5EqAwCmUUeAlfQjSEsapWhOwzo\nqThF/KNqeDRewS3EW3JGCR6o+DVdSNhy+AiWVRwBig7/UTJUpB+NpWc3WclI\nzy10Q4zp40StByYK84zgbj6hIidJ2Hsax2n+SSZmV0Qn6jdINy6xSFJf/WF9\nd79JPJMTYGea26FOhD3ZP5G1X5VkmrYQcOpX0athbYeJqoYXjNn2m/ocuUg8\nOTWaA+vIv3tQ0B0MPLhWYebNKvwX+CYF/BFbby0n0BI5NhZ6+OmVuU7WWLUW\np4sx8X2NRfHYCiieg6XyL0TYt1PWFGp49plXvu323omlbMIqkNGhKn+vtOfu\na1+d2vxugoNMF7Lmy/wmB1wpDtlGFBAd5jWXmJ6njHmo2pJSI3KYMLoeqIOL\nvFEsWVxHfdInq5CHtzOF03tfyjsGBoBEEPPr4YnZxacMsnI02F7VgbF6CEzf\nal6GrNrKOO3HKlrneS3guLFKRZw5razO/NYF8rZzWbXWaQGDpc+Os6e3laci\nVrzvXKBqp38o6MkUniEXeuDBID7HElAVeJxk9q4KzpJgHW0Pv8uvOtHjH0mf\noJIukyJg9YfEGChtzTLHucta1qkySqn/N7zdpsnfydpFgosvQdZMkBOlNU2q\n2iaC\r\n=vUl+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGne/slDcLUuJaaSzLjxiQwTgd188prg8HGFMD2/vYaCAiBaRVdDWkxWLC9O8uTblZY4HcfQ61wCNGaMwcKXbuvuIA=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.16_1601476964363_0.6733020457201073"},"_hasShrinkwrap":false},"1.1.4-b.17":{"name":"react-native-azure-iotcentral-client","version":"1.1.4-b.17","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/assets/auto_approval.jpg)","readmeFilename":"README.md","gitHead":"b6c2df2f6a48ca9c45e9602c1be36e1b6a4b536b","_id":"react-native-azure-iotcentral-client@1.1.4-b.17","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-LEbSTln+UmL2T5EFgPtUvOmevc6GPjKQrj1EVWGWmkQQAODr/IcEE2WxXPmYmRWbtfqz2HX5P6Rx2xxBUV+WIg==","shasum":"d57a7226d30d0338053de782129d37123aa32aef","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.4-b.17.tgz","fileCount":94,"unpackedSize":313276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdgCQCRA9TVsSAnZWagAA0lQP/2O8RF2thhIRZiviAuqM\naVCIM8VhumuQ29jFA6OzvIj93jbMlllfjveU0VMDrvcuz9mzU7ePMn5jrKQt\nmGSaA3zYEKlhGr37dT/plP2qbyFULp3UTOYDe/9cZ4jvv36TKqYBltH9RI8L\n4NKi+IQW5+MvEOV6JBmv0Kn+zX3llulAtXXP1Djej8KmxttkLprEAGw+EKyo\nJLNCENVJhCguHwiT/CAxWvuSh9IUmzVdrBlTYDR2zC8BCUZmdfU985i0A80u\nyerUFIyIeFMxcUu/qlXy0cRqPIxHkHScHZbfovh6UEJYsc5XBovYhznFsVc7\nDtSTguE5LWkzanFRQ4TpCQTmkC7p5bgAynSE7/Low7h8P+RmEwixD9xpCBxO\nuqfjkbQ6IJzl3w6Ol4ZsJIQgJBn8dHhG85nJPrALsY3KisrcNHRMcYylmeBt\n3qeyAKc8tvaED5SJJeMMxBzxcA3lcH8cKumwE9jpJfRfQxW8X+egqzDmhKYs\nI7qKf6SxhKa/slf2RGmPb/gkLcaIX7ywyhAkDPEniRFJMSHxkrW2c9fV5hOJ\n5mxrjxNR3r6Lr0nTwTkXU26+d9Da37ha7HpwnPQKIXokWhvdmv3XJ7V83Eft\nLVHn2ZFsDrIoMqfECz/l8Mh/nIkGQcPafCLyWD5wDCOA8Ixw8oGI628P4Bwu\n55uh\r\n=cdIO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLGeuPplbTiLBEp3do0+XLGYGgcwVAPK2Hvdb6QeUENgIgEgoCWtBGT3yytd4l5Z2Xf7BqES53wLnFyTl8pGDyfmo="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.4-b.17_1601568911923_0.19895686139628999"},"_hasShrinkwrap":false},"1.1.5":{"name":"react-native-azure-iotcentral-client","version":"1.1.5","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","node-fetch":"^2.6.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"peerDependencies":{"react-native-get-random-values":"^1.4.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"cb0a4527470f69ec0350297922f84e990cc32279","_id":"react-native-azure-iotcentral-client@1.1.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-kxacvrCDfMcPp8nRebIWQNy3NFPpJz630gpbcqwazxGcp2ZVnKQlQUEMXvsOLPvLxtXyKExM0rvtJVgrrpsrbQ==","shasum":"74c2bf241c34f1b23ebd035e4d49612c180196fb","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.5.tgz","fileCount":121,"unpackedSize":388115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffJqZCRA9TVsSAnZWagAAFQIP/1UySwLj+aoyAGLMieL8\nGlFzfmSO9Dix4xPxNW1KcqxMDClIpv/pDP11AEgJfuZPbBmzLdv/9Vw3zi6N\nTTDUlgfnU13ew25Ay7BxenX/wbX0ctUooTIDt/heOJoqxUIw9R4Netc/E14J\n9K+CSLE/Tc9VWttyAxzKNGCTO2ANjtMMLGJB7yZFY5vwefZG85wm35MUHGUe\nNiRj2AWIwNFjh/5Gs0S2BAwxAoonqiqY7xV1KA7KIKKeonvym4Znk9fY3+a+\n+Awr1X9qVR7zyTrnudwfIzEdRe6dfxA+J0MD0QXgvDwGCi+Ur8jfTHpfcHnb\nVCdl+HWMVEjhItp2DtmeKe5RMysCsJTxZbHLAiW+ZiPeH1FDqNF3lTrVqYIM\nVJfeugxxcTGAq7VDYwW4qEMAI7jAjPjlb3a1LM/PKqxHJLUwKYrUK/8D8iLj\nvVl6qbg4zdfNZcUc4lEyBO93uPn+kH8YJ6D1/F4vndJbzUtWELO45PCigktH\nff2qZgHh7yF/H+eKwnuLR3ss156M4pu2Fx+C0OjX8ipsY+sADf/FljA7XOIY\nry7oFMMNXlvKdHmOVzJLChyGArEWUNZ3sU31eXKNgtuL9YrkVyB8yICDYZPu\n9DQaCjhNkjxGNGB8+CUI4ZTHZjssffIj70Hd/3TAJJAGMSB/BH9YvgrF7uA4\n5txH\r\n=WWiJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgUysacYXlSxbdLQXYdvcbbCIO76Yca/KQsz8NuCXMZAiAFUoFsAwT9Of95qACWSUxl5ttcg8vakX2Pd9StlLHZHw=="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.5_1602001561240_0.4799855749332478"},"_hasShrinkwrap":false},"1.1.6":{"name":"react-native-azure-iotcentral-client","version":"1.1.6","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git","uuid":"^8.0.0"},"peerDependencies":{"react-native-get-random-values":"^1.4.0"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"d2d3344c465ffbb3c8362ff36f1da7e354813399","_id":"react-native-azure-iotcentral-client@1.1.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-gtJxNKwASSB7XiWUNqt+JymjHuIFc2kU4gYScV9mmS/12OgRNRcdTglcTHaHh42lDLl8x0Aqy2KDXXimi2b66g==","shasum":"40b6f60f6dc51387e06a5b2104ffab2fa549fd4c","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.6.tgz","fileCount":121,"unpackedSize":388098,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffYAiCRA9TVsSAnZWagAADJgP/275uHZWRCOr/NQ1uO7A\nUojtx0gNiDG83sPfVlc9fbisXB7Y596LE+PTQdeyir6vyKEi2sW6EifhaJFK\nnbNgXAQVNhACRwIFcUJMw7jIdJP+XxHi92aHLewjZu866QuT3m7HLHo1ClQb\n5euOHl7kPy1jKG1XTRrdhZ/WqayR8IfY8tiLRIFWPAPzLnNd+98YC+tr1Y7S\nFk4FWG9s3txeKhdQ/vrDnOtj8S4T10LoL+vI3rmjrH0tNQ8tUg3HHnF//A85\nfnMEE7qPKeiUG/zDVWnehXcE/TXb9HBUHc0GyaMcJa3D1XoyNTw6L/Vq9LhT\ndT/+DD7Z1XnmB0GYZbYnUbgNGiwuyBQzEp5W0zXAB/Nrui7cu5clZkrA9pdv\nc2dgfFhjWHatpezvO6aFUB7eYuzHGdfhOdqw3Vzvgx2KL1rfWcQaDe9RivMj\n7EW3OPQ5UBRzWCnMOUheBc0SfG/doriXdxbNJbkPtubLnC2LG2zpZ3dmo18g\n3OzM5fk/6be1Qg53iVGwzwTwP7iElGkt0yPtC9kZB563LAX9/g1cQNtcSjfe\nd5caHzMaF2JMIilqvSiorVvo07jWE47Jgx2V7691/J7B51j4OkYnoLReglzZ\nrwBsgWNX9awNSsG0pmua8nQeC6D/xwVzK52VFRVJUvxmLVuR0bSu1Q5ron8n\nMYXU\r\n=OxFd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDR6NHFzze21ZH5rv30wctGLti+TIDHXCpglDc0K++GCQIgdO1K3YDkBq5gRN+2D/6Pq/eETB5YGSOoQ1T/gZizWTw="}]},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.6_1602060322196_0.3591478742088603"},"_hasShrinkwrap":false},"1.1.7-b.1":{"name":"react-native-azure-iotcentral-client","version":"1.1.7-b.1","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\r\n\r\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\r\n\r\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\r\n\r\n## Getting Started\r\n\r\nInstall the package and its dependency:\r\n```bash\r\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\r\n```\r\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\r\n\r\n<br/>\r\n\r\n**App.js**\r\n\r\n```js\r\nimport 'react-native-get-random-values';\r\n```\r\n\r\n### Types\r\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\r\n\r\n### Connect\r\n\r\n#### Symmetric Key\r\n```js\r\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\r\n\r\nasync function main(){\r\n    await iotc.connect();\r\n}\r\n\r\nmain();\r\n```\r\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\r\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\r\n\r\n### Operations\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```js\r\nsetInterval(async() => {\r\n            await iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, properties)\r\n```\r\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\r\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\r\n\r\n### Send property update\r\n```js\r\nawait iotc.sendProperty({fieldName:'fieldValue'});\r\n```\r\n### Listen to property updates\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, callback);\r\n\r\n```\r\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, async (property) => {\r\n    console.log('Received '+property.name);\r\n    await property.ack('custom message');\r\n});\r\n\r\n```\r\n\r\n### Listen to commands\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, callback);\r\n\r\n```\r\nThe callback is a function accepting a Command object. To reply, just call the reply function.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, async (command) => {\r\n    console.log('Received '+command.name);\r\n    await command.reply(status,'custom message');\r\n});\r\n\r\n```\r\n_status_ is of type *IIoTCCommandResponse*\r\n```js\r\nenum IIoTCCommandResponse {\r\n    SUCCESS,\r\n    ERROR\r\n}\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device explorer page of IoTCentral\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Manual approval (default)\r\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\r\n\r\n\r\n### Automatic approval\r\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\r\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\r\n\r\n\r\n## Sample\r\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\r\n\r\n<p align='center'>\r\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\r\n</p>\r\n\r\n## Instructions\r\n\r\n```bash\r\ncd ./sample\r\n\r\nnpm install\r\n\r\n# for iOS only\r\ncd ./ios && pod install && cd ..\r\n\r\nnpm run ios # or 'npm run android'\r\n```\r\n\r\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\r\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\r\n\r\n```bash\r\nnpm run build\r\n\r\ncd ./sample\r\n\r\nnpm install\r\n```","readmeFilename":"README.md","gitHead":"e9fbe5c60a3eb60438bf1688c8c8f68efdcc769a","_id":"react-native-azure-iotcentral-client@1.1.7-b.1","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-LFBFsuecoKydNY9/JjDJMRDUrdKvz8sTEB+j4krAY31VhJoI5AUMuDehPlIYUIw69w03LkSASy4jiIs0jIpClg==","shasum":"0c24fd2d8bb0e9df5213b5166a4487e496cb7dd1","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.7-b.1.tgz","fileCount":94,"unpackedSize":319993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0z21CRA9TVsSAnZWagAAcJ8P/0LqRGcE6/EAv+eXVCKh\nJzp6UQanp9DYYoymQ18/ZvoBV9HQIJRLAhTB2LlEV4Kjwh0elT/ViBV3jBZu\nc7WV7cFpFZ3Dbl5IZYZQEcoHGSYjY5+kem/LvHNQIhZdeNDKWPH1Ug929km7\njM8dFz2gD3O1Wu+MjMdOSr8q6qJyIJ8tsh56nA9KOzPZ0lRnLql4e0u+IBbU\nkt/Ify7hYbxHYsvtv94MRtaHljIHLVYFnBswnkeLIXc40DgQjcPr0S41GEd0\nYR/zbWqIlt0jDwClKUl3/LTi9P08FUMLuabPlo4nTL6cZQUGcqBC9yVXMJah\n+/pG6eMp+eDD1lGfgCNdFArW+pkNYHqT3fM+Cv25vOt5kPs1dlhVTnE63C3C\n1ru8PPG7XS1dyyLtyLU8gUGnZGcykltdoYtUpKLbe8Dde4JCv+9M1ssR0+Cn\nUzKHNJColEObhnfGYuPsKzDeaqqKJ8ZOuvdgq8T6h6fuPwAHaU1y3vUgt3Na\nOEv5gB6Wy+iKw65OASQ+LYfiQTvatpljCK6P8pBBs1tIN/IZELVrtYi323/V\n0eRrr9tzfyHRT7IIdYwdaJL+BOtuzbmep6ONQ6mMEHgLhBGeFmp9IZxgpb9k\nPVBntFUvUwXE8dQxnCKP4ga68vD7dfy2QJ5qcoI12cu6uKEUoM3f1yHggQ4K\nnSKH\r\n=P/Bm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuSc0hTmLfByS0CCOfax+t3/AdWmY9eWLIVaEdBGuSrQIhAOQItGxRtqY/bvdKFv47+9sm+53biZRxvGUN55pDYQSS"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.7-b.1_1607679412865_0.7322416025139535"},"_hasShrinkwrap":false},"1.1.7-b.2":{"name":"react-native-azure-iotcentral-client","version":"1.1.7-b.2","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\r\n\r\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\r\n\r\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\r\n\r\n## Getting Started\r\n\r\nInstall the package and its dependency:\r\n```bash\r\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\r\n```\r\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\r\n\r\n<br/>\r\n\r\n**App.js**\r\n\r\n```js\r\nimport 'react-native-get-random-values';\r\n```\r\n\r\n### Types\r\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\r\n\r\n### Connect\r\n\r\n#### Symmetric Key\r\n```js\r\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\r\n\r\nasync function main(){\r\n    await iotc.connect();\r\n}\r\n\r\nmain();\r\n```\r\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\r\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\r\n\r\n### Operations\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```js\r\nsetInterval(async() => {\r\n            await iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, properties)\r\n```\r\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\r\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\r\n\r\n### Send property update\r\n```js\r\nawait iotc.sendProperty({fieldName:'fieldValue'});\r\n```\r\n### Listen to property updates\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, callback);\r\n\r\n```\r\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, async (property) => {\r\n    console.log('Received '+property.name);\r\n    await property.ack('custom message');\r\n});\r\n\r\n```\r\n\r\n### Listen to commands\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, callback);\r\n\r\n```\r\nThe callback is a function accepting a Command object. To reply, just call the reply function.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, async (command) => {\r\n    console.log('Received '+command.name);\r\n    await command.reply(status,'custom message');\r\n});\r\n\r\n```\r\n_status_ is of type *IIoTCCommandResponse*\r\n```js\r\nenum IIoTCCommandResponse {\r\n    SUCCESS,\r\n    ERROR\r\n}\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device explorer page of IoTCentral\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Manual approval (default)\r\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\r\n\r\n\r\n### Automatic approval\r\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\r\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\r\n\r\n\r\n## Sample\r\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\r\n\r\n<p align='center'>\r\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\r\n</p>\r\n\r\n## Instructions\r\n\r\n```bash\r\ncd ./sample\r\n\r\nnpm install\r\n\r\n# for iOS only\r\ncd ./ios && pod install && cd ..\r\n\r\nnpm run ios # or 'npm run android'\r\n```\r\n\r\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\r\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\r\n\r\n```bash\r\nnpm run build\r\n\r\ncd ./sample\r\n\r\nnpm install\r\n```","readmeFilename":"README.md","gitHead":"dcf208b570374ca32d4bbd8cf9ac3f356452c5b3","_id":"react-native-azure-iotcentral-client@1.1.7-b.2","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-Ajl93lJPYuYJnX8R20CxkN1etlVsFKT/+YhRRDNC1rtAZt9NqX8F7J3ySWDpr4WTZPazHfDLhmXJOmx+xgpwNg==","shasum":"ed5727fee5a1d8e9dc6ef43fc5bbb1c695c76abb","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.7-b.2.tgz","fileCount":94,"unpackedSize":320675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf01VbCRA9TVsSAnZWagAAXB0P/3XEaV+GLsh65j1A5r+g\nrOQswygjbafrHCATvDUTAUVfc8/XQNWDIaMAsLJ7dbPWg8Yxl/pqXdK1v2fG\nGpVxn8j85p0DLZIwpkUovQZrGRH/VdHlJY4Q7pQEUKVPRt9TYkPufEFZ+DUu\nW7IN4Jhv/ypb51kTiQ83DE/+vych7HnJ1R2PcB0SA4+ztrJ2lEIFBtjAd+W5\n5IB3gZbGk3SzvEwDmeSmWIF40oueZVHinpGDKT9L4zouEiiW7oIcqgpQqI7O\n1qBhOrvkA5xQijk8eopmDWBfitQuCqKibPRUc5ja8jRW7MRezA2aKOcg/d8x\nQc4hvMTqP9fZSK8EMlxYoNg+K2ZJt9Z8Lkwi5QPkSkTSL4WX8bJZhBu9/hRm\ngbQCojTgPwB6GeCA1isg6rTMISsirGfQPSh7MPhYkZJo1TCNj1kKTM8p/mC9\nvaP354E6jFHSD0PBFzD15bqgsSdb6lghKlEgrp52+KD6K1rD4GP0Assg1ChK\nvNBtqYI80lI0q1qqnLRaAVQoi2/aFXylK8KZgXYVyRNtfwXUot85JGX6pRgD\ns2rhEV4uidiR5RJC5UBByF+Hc0tn/KBIKvYAnBHUEsPlY8mVN/hw0Y9BGJKB\nO7kRDkdmFuhDSAq5eFQvSCn72laoRSXL2coE58GoK0ZuaHRovGEp+AO3eTXd\n05vJ\r\n=Vahq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBnh2wMp+z63KyE6hyyZdqBqchVsUjKmLe+gyWOP0xjwIgUvyv9R0/drvnUqmgKgfdZKVE8o/qhkiNrHJl6RcttgE="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.7-b.2_1607685466857_0.538567657885733"},"_hasShrinkwrap":false},"1.1.7-b.3":{"name":"react-native-azure-iotcentral-client","version":"1.1.7-b.3","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\r\n\r\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\r\n\r\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\r\n\r\n## Getting Started\r\n\r\nInstall the package and its dependency:\r\n```bash\r\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\r\n```\r\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\r\n\r\n<br/>\r\n\r\n**App.js**\r\n\r\n```js\r\nimport 'react-native-get-random-values';\r\n```\r\n\r\n### Types\r\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\r\n\r\n### Connect\r\n\r\n#### Symmetric Key\r\n```js\r\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\r\n\r\nasync function main(){\r\n    await iotc.connect();\r\n}\r\n\r\nmain();\r\n```\r\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\r\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\r\n\r\n### Operations\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```js\r\nsetInterval(async() => {\r\n            await iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, properties)\r\n```\r\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\r\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\r\n\r\n### Send property update\r\n```js\r\nawait iotc.sendProperty({fieldName:'fieldValue'});\r\n```\r\n### Listen to property updates\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, callback);\r\n\r\n```\r\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, async (property) => {\r\n    console.log('Received '+property.name);\r\n    await property.ack('custom message');\r\n});\r\n\r\n```\r\n\r\n### Listen to commands\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, callback);\r\n\r\n```\r\nThe callback is a function accepting a Command object. To reply, just call the reply function.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, async (command) => {\r\n    console.log('Received '+command.name);\r\n    await command.reply(status,'custom message');\r\n});\r\n\r\n```\r\n_status_ is of type *IIoTCCommandResponse*\r\n```js\r\nenum IIoTCCommandResponse {\r\n    SUCCESS,\r\n    ERROR\r\n}\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device explorer page of IoTCentral\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Manual approval (default)\r\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\r\n\r\n\r\n### Automatic approval\r\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\r\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\r\n\r\n\r\n## Sample\r\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\r\n\r\n<p align='center'>\r\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\r\n</p>\r\n\r\n## Instructions\r\n\r\n```bash\r\ncd ./sample\r\n\r\nnpm install\r\n\r\n# for iOS only\r\ncd ./ios && pod install && cd ..\r\n\r\nnpm run ios # or 'npm run android'\r\n```\r\n\r\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\r\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\r\n\r\n```bash\r\nnpm run build\r\n\r\ncd ./sample\r\n\r\nnpm install\r\n```","readmeFilename":"README.md","gitHead":"d6b3c38fb9d3ad74ff1dd79953ebe6a9f8f3e62f","_id":"react-native-azure-iotcentral-client@1.1.7-b.3","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-JcIgCzwDl+HlgFWapJDHzLHOr+NPoAdMQ5vuhLFqZj+B9AaBdkfsyY6emm/6M7//p8SbKGDrXQGQobr2V1XxNQ==","shasum":"68433fa2727d2e3a0c9747aa4bc688bcf80d0a7f","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.7-b.3.tgz","fileCount":94,"unpackedSize":320596,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf03miCRA9TVsSAnZWagAArCIP+QFGFyu+6mkrKJ4Fx3+y\nUkZxUncxSx1p0dunlb4RqIkDSuu3LODaARARAqqRruD8BnRHMcFpq+H5/Cib\nEXvFTPlpHBaFAPZ9hiQyi6JbIcxjjBwvUwgSG5vTvOcqg7Z/tBV54ncOZCiH\nwR2Zn5+OeVPfkzdXdOYp4JyUD4G2Seny3tPYTmR+cqR+OaGeNt+/r6cBPHxz\nbekZI76En2zz06JHhDu+M6VZ2WJKtA3RyV/FWOR+Ua/PzxzGW9y0L+W01/xn\nK2WiGUiC3a5dV7X8KtLVMu0v+iqjlDYOqyav+nEzKXZi7OYzMGFIC1FDFsdN\nAgt9IvUJw+G4W/Ym9nr6rT1ULHD3F9D6lYS1BWKYKsCAtX5eMxfPHaI1uMbc\nTzuQuqHTyc65bkW3KoILDMQZMK76gkg9h4kw/u2mUqums/I3Hy7jUjiYUOBn\nMvVhEW0W6emTtmNBuXV8f72G+1pxzbI5Jrzvo8d7y7fHULVxBeH1FwJudsKg\nozxInQS8m3jzQYGsPQV0Ix2S6Lvu71ZS87DP8PDI8RYqnEKZCoZ2umnR7ozA\nJbRPTIWVzqg2/s12Npyw51XH2HgPS0nzq2pcR5tEiRPb3VyeE9xhkbTXhQ8y\nsPaZ5uoWKlbe6bOt5jFulzyV0ahFMxxcqvC8uMKnkyeoIvS3dbQGWPTId5U9\nvJz6\r\n=1NH7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdU7iRqT6WUJh5g7ToQUJpSYqr94WMTen+CTzyeu5fOAiEA8vjzpMHTQXd1v0fVvD42O/QfIbDesvYNXxvQpHHKxSk="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.7-b.3_1607694754207_0.17366454804201537"},"_hasShrinkwrap":false},"1.1.7":{"name":"react-native-azure-iotcentral-client","version":"1.1.7","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"c8a0fb4fb80fc82cabb68ed917db08e95a7e9e08","_id":"react-native-azure-iotcentral-client@1.1.7","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YOWAPS0j1/nFHFWskTKKZqcjeLq1De9TsEWohaQ6Ds9DrnG1U172ocqjaCKXpDYpGKWwY7mgvfQ77Dd+6NxgDA==","shasum":"5637836b668e137688d5bf1906cf3a4ddd302c06","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.7.tgz","fileCount":94,"unpackedSize":320456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf034BCRA9TVsSAnZWagAAx5IP/iG1WgaziI2KOqKX1t+A\nE0FtKb6qEZL3fgQy5Msm9P7Q/ou63Cw5BHtc0HSk+d30mGYxPObcTm/5EFpm\nak5OZQxHiO6VAQs43FSTUj2MpfEdXoFjRec3zeDoXW2uvU7sTsiqhDBo6HpU\nyKEWgxmkRk5WWPVRMJq6sD6s/YUOMH1XlpOeDWq0iqUFaiBnx22SVYYEtlr3\nNDGlRdo3YxINqWkrDKp00E2UFuH8jcBAS0vRi85VFB3AbhqXUy6jhUj2vknr\nj/ede5er75Cvpa4HR2s7fGjwfPa7UZrMLjrb0kPhQDQ7j/giP8XG/X0yOLt8\natbFglfRCu/TmjI7jLU+EisteSqPHL9C1KK3GWQsq4ohocznqRL7RAEwWuqc\n88Kbcb2aF7sY8MPxwDZlzKi7poF7vsbO8RPJcFX4WeDob+OhVTSlXY6XpZKu\nJPYGoNjvKOgjpK/x137HcgYLauHz+A+Ofs2zyT2fTjuFGG1L9hotGoHNAUjn\n98EEE88l2PlRbTfsvtKKu9yuCOST/8KYv0PoaJYvMLMXLE3AFb8+5bm7/u88\n3MOy46x5TR48kscvxHsQQDkCcbqM9DWF+E+FGoSEUFJcB8TSbEBKUiMpdApk\nFdFlyxEWLTYoA/A7MD3SUcbXe2Wvk2hBiZ94+hdKssrOHMlkmYEZ+hLng9aH\n+GqJ\r\n=RT1X\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBRMtE2aNwH4YNQoKgZVkj9q8eW0xEJOsmRYZFXBsZ4nAiEA0GThCqtE12gfX3kYFmkibxFAJps449mFYbu9fVnMNQU="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.7_1607695873017_0.8522648558867003"},"_hasShrinkwrap":false},"1.1.8-b.0":{"name":"react-native-azure-iotcentral-client","version":"1.1.8-b.0","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","clean":"rimraf -r dist","prepublish":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","rimraf":"^3.0.2","typescript":"^3.8.3"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\r\n\r\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\r\n\r\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\r\n\r\n## Getting Started\r\n\r\nInstall the package and its dependency:\r\n```bash\r\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\r\n```\r\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\r\n\r\n<br/>\r\n\r\n**App.js**\r\n\r\n```js\r\nimport 'react-native-get-random-values';\r\n```\r\n\r\n### Types\r\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\r\n\r\n### Connect\r\n\r\n#### Symmetric Key\r\n```js\r\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\r\n\r\nconst scopeId = 'scopeID';\r\nconst deviceId = 'deviceID';\r\nconst sasKey = 'masterKey';\r\n\r\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\r\n\r\nasync function main(){\r\n    await iotc.connect();\r\n}\r\n\r\nmain();\r\n```\r\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\r\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\r\n\r\n### Operations\r\nAfter successfull connection, IOTC context is available for further commands.\r\n\r\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\r\n\r\n### Send telemetry\r\n\r\nSend telemetry every 3 seconds\r\n```js\r\nsetInterval(async() => {\r\n            await iotc.sendTelemetry({\r\n                field1: value1,\r\n                field2: value2,\r\n                field3: value3\r\n            }, properties)\r\n```\r\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\r\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\r\n\r\n### Send property update\r\n```js\r\nawait iotc.sendProperty({fieldName:'fieldValue'});\r\n```\r\n### Listen to property updates\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, callback);\r\n\r\n```\r\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Properties, async (property) => {\r\n    console.log('Received '+property.name);\r\n    await property.ack('custom message');\r\n});\r\n\r\n```\r\n\r\n### Listen to commands\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, callback);\r\n\r\n```\r\nThe callback is a function accepting a Command object. To reply, just call the reply function.\r\n\r\n```js\r\niotc.on(IOTC_EVENTS.Commands, async (command) => {\r\n    console.log('Received '+command.name);\r\n    await command.reply(status,'custom message');\r\n});\r\n\r\n```\r\n_status_ is of type *IIoTCCommandResponse*\r\n```js\r\nenum IIoTCCommandResponse {\r\n    SUCCESS,\r\n    ERROR\r\n}\r\n```\r\n\r\n## One-touch device provisioning and approval\r\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\r\n\r\n### How to set IoTC template ID in your device\r\nTemplate Id can be found in the device explorer page of IoTCentral\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\r\n\r\nThen call this method before connect():\r\n\r\n```\r\niotc.setModelId('<modelId>');\r\n```\r\n\r\n### Manual approval (default)\r\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\r\nThis can be done from explorer page after selecting the device\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\r\n\r\n\r\n### Automatic approval\r\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\r\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\r\n\r\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\r\n\r\n\r\n## Sample\r\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\r\n\r\n<p align='center'>\r\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\r\n</p>\r\n\r\n## Instructions\r\n\r\n```bash\r\ncd ./sample\r\n\r\nnpm install\r\n\r\n# for iOS only\r\ncd ./ios && pod install && cd ..\r\n\r\nnpm run ios # or 'npm run android'\r\n```\r\n\r\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\r\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\r\n\r\n```bash\r\nnpm run build\r\n\r\ncd ./sample\r\n\r\nnpm install\r\n```","readmeFilename":"README.md","gitHead":"7eb361be208557a35065999c2f8ed0c8728d78c3","_id":"react-native-azure-iotcentral-client@1.1.8-b.0","_nodeVersion":"12.16.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-4NAZwzxH59eFnwK/knVrydLzNvgXXuvP/YMuVChdth5v3zqJ30aK6G4qaVxGX+Ihp1e5+kcokyGDreGfoHH3Fg==","shasum":"330303bc3c7f5af8813e0c7211ef5302cf7f2fa1","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.8-b.0.tgz","fileCount":94,"unpackedSize":320874,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf4Na5CRA9TVsSAnZWagAAJhwP/27rKP5OvtAtGmz3L6FA\nJJpzeVnNOmb1981Pfg47x4o4kD4qTFuM96b4/4idJlyuDPN8eyJKeLs1Nem+\nMiWbIczi6hG+EAztYtNj/71/rz/ptPczDAmzg5pYLCvaVPNwTCELGxq3RbPy\n1scxATFZHHuXehUDXSzPOc7LZiKkBUAE9DqgSN8ZQ7mXaOWHcmxCU6SBoybV\nctas7C0KUijskHZeOpjqDBAlLxQWpbnzSrAHnP5hkcXBGTUW25X2fmo5icL0\n2dSra6WKkCp8sQbQOzeqW+WTT43stdJxTMYm/4z+hlENJu4iWMElBVsUOMmP\nyex8dKypNg3ZwJ1FChyePEc9JxNeFwxFPo5Y3Bt6dBc6pKwpcRI+Ir2IkOya\nh3RImIz3AFM8i7V9kEWlyaWD2K1vuFLlCB7Q0QzyjsqkjLvVIKrJOv2VcNR9\nj/UsO4eGFWGuea/cM1Okh4hNraoxCLjwOpenJOQzjFYYUvNGb7+hqCTvrz8Q\n+GhZXfG6qkJ2XHeC/DqpWqIrggry4ZgHOebq4Ju/ARJSuRONItN8BnKkWCv8\nb8hBRpoaxfrVzSxLGBdpkR7zte5ii2sXrnSPFIxznjfwJYpAOWfGsYk7dPgm\nttZlQ97lh3TmwcYY2XlcofP4kwYVJLhYS4SVbKEndUFpjnr7RLwBBTArThUX\nElGX\r\n=HdhH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF4XTPgeLJE+G4LPsWFnnp0ZEEdD6PNxiOrF09kYwJBQIhANW7/2lVbpCo545gpSBzJ9q98ySqwB0CbNwaN0VfEXkO"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.8-b.0_1608570552842_0.526678413214402"},"_hasShrinkwrap":false},"1.1.8-b.1":{"name":"react-native-azure-iotcentral-client","version":"1.1.8-b.1","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```bash\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Types\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\n\n\n## Sample\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\n\n<p align='center'>\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\n</p>\n\n## Instructions\n\n```bash\ncd ./sample\n\nnpm install\n\n# for iOS only\ncd ./ios && pod install && cd ..\n\nnpm run ios # or 'npm run android'\n```\n\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\n\n```bash\nnpm run build\n\ncd ./sample\n\nnpm install\n```","readmeFilename":"README.md","gitHead":"15c13884d7e3e959f5cc4b9dbccc2535f54026bb","_id":"react-native-azure-iotcentral-client@1.1.8-b.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-wFXsFKU1xmChG068gr6X1ul1BKVoEuDuakHVOFxMpmfD3GXiKxvuhaeZXGa8TaKzj/+KSp4wA++l5mfOmkngWA==","shasum":"1e6d06c455f18c22e49715959b4184655a9a66ab","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.8-b.1.tgz","fileCount":94,"unpackedSize":320528,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgef4xCRA9TVsSAnZWagAAJ7AP/iG614WVx4IqEoVmFHNQ\npush9/pA+rMJwcTXBWPECl5ubqgnzdiVuTM0gXLx3c7UOVv7ftduRGyRfGQd\nvS3yJQfCG1D/wUZWU8DIMn5tc4dNTIoJWr/M3Zvv+oyg5iboWD85zAzy+76S\n17UC+lnD+UIYZjrNz7hoeZLE343NpuAJfYq7I7IJPDQZIRNcYh2oS1yDMEJV\noM+zaaD5vTnAtfNkKVeLomBaEfAsQgyFKTZuvRd/mPyEMKQ/L1r9hoklCZET\npbzp7qZU+DyHy8/XumLS31+Ege/pFuyIpCsls3wMvDp861mD8neGmJAdXKb1\nf4RnOurUD/BUk5fcMTUrdHuipixKCWTs5MxgM1qL8kXkmD5H8RdiasprzXbF\nV1e7O4DBasKUuRAP5cp88e9iqFtVEcT0GLge8O8EZpVEl8hc0kwseShsqKFr\n99/C8bma0ixfgQdKENo0cWsUnukv2APm/nZ+AXW+zsJAqDYcBeYbSWPrux6N\nVLuUwKBSkpHJ4mSeIvCh7r7SwUz0ClubNtPEyc+yc4an1cqwAx8SzlF/3Lsp\n60AmOVCUMSUhr00DY40GlacDoD54jEe8l3+avanu9wupK3zvnD6ioGzOfEJP\n3bIKiLHmYp7p5PAURQkwTLmzBZBIMy4HCp2YrbAd+amFiAj2X6dTK7tD1w8g\nxeq0\r\n=JIVP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDY301AHICJBFVcsHu/clXcySA47+Dr/m5z5COJtDzmgAiEAtBaoVGabGWwpz0k0BsyjYy+9qamrXbJP3dtspFvyTj8="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.8-b.1_1618607665278_0.8149142616526601"},"_hasShrinkwrap":false},"1.1.8-b.2":{"name":"react-native-azure-iotcentral-client","version":"1.1.8-b.2","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```bash\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Types\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\n\n\n## Sample\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\n\n<p align='center'>\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\n</p>\n\n## Instructions\n\n```bash\ncd ./sample\n\nnpm install\n\n# for iOS only\ncd ./ios && pod install && cd ..\n\nnpm run ios # or 'npm run android'\n```\n\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\n\n```bash\nnpm run build\n\ncd ./sample\n\nnpm install\n```","readmeFilename":"README.md","gitHead":"ebe856a7d0739881927f6de520c4f08bb56a1eef","_id":"react-native-azure-iotcentral-client@1.1.8-b.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-3Ezl/VY8RrL0E7u9EWjyBwWXAnUxqoDwcLf+5y0qOI5ufQxYimm39gh8OhyYTBtLErzWm25kmL75ZVr7dBcpQA==","shasum":"86541a837f3ec9943d5cad5b73b6f999531b47fd","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.8-b.2.tgz","fileCount":94,"unpackedSize":320588,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgegtsCRA9TVsSAnZWagAAJpYQAJupSu86p+YvAKEtR/o2\n6kwRCo0LZ2TlxadVNCHoilCPJHRWBX1xgbSuq3whYWenYuhjuF9gR20Q5Xsw\nuvvj7Rm5WpHd/KG11m+WqPFPQc1G36y2JxVRCrU97OoQ0sFGPx9elaeeS9ar\noVgmqaSZU96cbtyDkD8h2h1Ly4rE9Y7EwiSY3w2GtRvZovt/qSRfaVfpvVdT\ngCDIyWeVq+JbfnLeRTXT94CqJzEraD2hKJKznbF4+xuj0754unlj4C5Y9Fwx\nBloC+jhl0WOcJG3Nh5wH+J3AaEg0reUcq9sA3O+K9jHecw1LZXzDBuMGCY6j\nBqAe5ohAzWsaoLj3sMxjyhcAGkoNAK5YbQXtUZfwB1oPfPlzdbP+qkarWuJ6\nQsE1U+zwG9ciiwafthOv3wRiaKIMqAeqW+Efu6kF6GKM3iL0O4i5ygSNa3XI\nVtPSxvuz9L+QNAeGj2lKv3o0i19NxsQjrRHtqd2qV6nMFRjx/vdv7QiZwoOB\nug/AK1Uz4Fsf75X/u3cvPO7fPCvGCnRT4014Ug/BVc+ZNgmoybTW5x0CUPAc\nczBU5ZBJdOWFdlLflDULYgG9LP03V8waEu48YFPNhcXhStC4Ge4c7tzoCLfB\nRpUxXKFFP1nv+tOuSF+c8kIqFn0afjFvPr1T8riv1ypfHWEwfx/ZXH9/yPnX\ni5f3\r\n=3orn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCH9MlMfqK31/9q5fEGITJt2ew7UlASi4WMOqA1y2R+UgIgQB5mNuRumcwx9y3LqZDCXG1+G6zQF+ljcKwHS6klTeY="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.8-b.2_1618611052002_0.2509044600737147"},"_hasShrinkwrap":false},"1.1.8-b.3":{"name":"react-native-azure-iotcentral-client","version":"1.1.8-b.3","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```bash\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Types\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\n\n\n## Sample\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\n\n<p align='center'>\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\n</p>\n\n## Instructions\n\n```bash\ncd ./sample\n\nnpm install\n\n# for iOS only\ncd ./ios && pod install && cd ..\n\nnpm run ios # or 'npm run android'\n```\n\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\n\n```bash\nnpm run build\n\ncd ./sample\n\nnpm install\n```","readmeFilename":"README.md","gitHead":"0a785fee98e68505966b6c492c92f6a9ab3b4f57","_id":"react-native-azure-iotcentral-client@1.1.8-b.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-Yh6vPb/WMTJlk3P0KwN01UXZCCQ8GyUb9BzDBZv7oJlKZySVFVFmftQD8np6QAwUf+ENcsh5rGWmRnvKK6MIyA==","shasum":"71050cbb66bca6c303e54c8f4a177ec5191ac857","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.8-b.3.tgz","fileCount":94,"unpackedSize":320604,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeozECRA9TVsSAnZWagAAIEEQAKEwq+gGDg04sBIr94L/\nUW9OCyPOCmlbSkK/9EKt/IEeOzqrYzyNRcqm5vmdoUa+wJQxtATA2PyaH51o\nsAI58255i4zhIohvnypE1DX/6PYuI+7lW0oD84nPKNHHCM0TVq9h+c8YEdxn\n/DZwgWX2T2aLg0CicQOH8uuuQraP66pGTDw4fZaZF/4FfZSjOECr/EZjl2XF\n5bsm5ppbZS0RWNfbPq4dn9/gpZ7ssMNIJbwricNZlItTLdJOVluKBMYykkoB\n1kYM0se5Zf6Cp9kDeXim3GoqGF483qpXvhMw1XVzViNZNYvz5unD80eOMDsK\nPNSncij4hyFZx/IivVcc0mnxoQoaZ/n+e6oxBWpGHBQsxoCtVfIylJeEZ+5p\nB2L7hMMI9gH+6WC10OMIlgygjLcvp5qypobrJBQEC/dk/gJjSH/g7j06ORfD\n6kgilsM60AD/J6LtzVLTp1LgH8ZJnAPJ54QjDnhZ05fw9g+4kT6aVUquyUvl\nM6szuLETiJ3ja7qpjRPUYAWyHFBABBeMl6EoIQ8V+8fssvgvUhqpUPfgrjVH\nXQlDR20U7v7WOjJC6XfN5JZ7M07SKcC0OeOPRqCASyLB6K4F/c+2UKrfUGsh\nE8Lmft3zpLKufuVffWTg7DHl0S/5VN/9Vjl8xnsINlRaSqm21buxBKvX2FC1\n7ixa\r\n=eHQc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVFS2QcSNuMBQSr1GUXPVbv4AT2nRQBWqliYZII58erwIhAMdNEeeL1GDlnuZ9ql0Sij9yqRZV0SZ0XWqX9xT76HIT"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.8-b.3_1618644164042_0.5547650439826983"},"_hasShrinkwrap":false},"1.1.8-b.4":{"name":"react-native-azure-iotcentral-client","version":"1.1.8-b.4","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```bash\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Types\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\n\n\n## Sample\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\n\n<p align='center'>\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\n</p>\n\n## Instructions\n\n```bash\ncd ./sample\n\nnpm install\n\n# for iOS only\ncd ./ios && pod install && cd ..\n\nnpm run ios # or 'npm run android'\n```\n\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\n\n```bash\nnpm run build\n\ncd ./sample\n\nnpm install\n```","readmeFilename":"README.md","gitHead":"fcfad173240f4485d2042c27c10dec6c6362ce65","_id":"react-native-azure-iotcentral-client@1.1.8-b.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-7PEq/qeuobzBa6mLQcxjv3Nx5jW0IBzDw9vP2ZVouJvChGDtZLs2Tu4587v7oRDbaOMgKghiIiVVa3vs9kG2VQ==","shasum":"f5ff1ba06d231937bd4568a5aff767268251e1cc","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.8-b.4.tgz","fileCount":94,"unpackedSize":322552,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrRIaCRA9TVsSAnZWagAANYYQAJa2TZ48RExvP7WYf3kM\nis8spGdFPpns2ZRwa9Gx6bcpkg4L48hho1bhw/j/RtkIZnpkq5MyndcRrw+N\nLSRl4actw8jZ8Rt02Amrbn2Iyol1Y0qHV6jsFcjX7oOBMzndOrFP0gbYNyrF\nlYn6hC02EivCjIe7BIZhq0b9IHlaAcVBxju8MbqhMsjeCdOhbKI7x1w8AypT\nYsqzpD+aeJUGt2n8bTN/YRQf3qSgxR6NxGsUtgbS47pr6ZcIE0TsAVDgTlLo\nn54j7eVZUqhd/W4Qy/QIqHsURD1bZMXeoDc2N4QpYlXChVtxXWxSuwzFzRp2\nD1VHEr4Ka5E+k4h8LODmAEQMs0loVDo1dXC546dwgYmPK8RdiJtr1DKT5r4A\n2jmsw0HecTh9mSk7jHC1qyn6OtqJeis8306oNlkkinLWXKwnFRYa9fIc44oV\nFmtCDrPESZci9fXXKCi9etOAeZQ4WCiKWrDzcsYWaES/kWVWoH4CvhxHx0Yh\nibRPC+61RcdoRh/gnmKW9OtbnMM16B0+rpgvmqbwMwt61a5+NFBorfCHOkIA\ny78olHBB8M/eFoWmcOH7Z6rgXUUQjzzVa3IWIGstHsEuRxqbWQxkTiBHDT74\n90RmDZGYhZL9fqv2UiejBkT8mkvepMiDl6Kfb6jbhsUUaJJyBh9s3AHcFT2X\nWSrn\r\n=Hn4h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkMRZok5T4Ds0eilznKdq7Yb83tL/IMx2E+yHU+Mp2ywIgPNM3D0hBYO+pyRPOb8/BR9XmDgpAfihgavrqNWj7vjI="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.8-b.4_1621955097789_0.008953848257545305"},"_hasShrinkwrap":false},"1.1.8":{"name":"react-native-azure-iotcentral-client","version":"1.1.8","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"6f7c90321491ac3e9a493ae27f259a6e95e7a654","_id":"react-native-azure-iotcentral-client@1.1.8","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-0SU3fK7GqkXYKEGaAF5k60af8fY1clRy569ICjHLGfCvqU0xqZdDnhy9jxflMN2Ad0AkDN4Ul0CsU3Ih6daQZA==","shasum":"e750e3af700082ee13a57bd6ac7af35de1d4b057","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.8.tgz","fileCount":94,"unpackedSize":321697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgxxe6CRA9TVsSAnZWagAAr50P/i+HUY7TIN9QxGTB73aP\nlvALASmopCrpYPF+cqOt8H2ztkaUq4a3tzJI3XtrU6iwEodF30pgAVxljmOD\n+NXeXtrq6NG6sajxeUx/DSMNxn+A6xye2w3TDPHi5w8ImrAyokp9EXJqimUR\nQuk+UcerbBUG6csiNqMJhzNOZmOqOs52aJc0S4TGL0mWhG1aXvePkot8BwXE\ndXC7qSrEJOgwIlrlr2I7O5hQ9mOiE8COjAe0PWkPfRyuI5is9jDHG1tu/CDx\npagLYDtrq3DFu2yv7OxHmk9T3K2ZGgmUnEdenrNtqANa3yR8ik0cwdFPa+cn\nzxaw8FyMg4C31Fdjqo2t1YI7XzLv0lm9COyCU2zA/IHwd+bOKxBukc+EUqGK\nQSvWS4U4pen6rwkgCQ2D8uY9xrcl3X780ilop8vefFcUo4HXJMf49MH6Ch5V\ndUT5WzE3lpqshSNAVfs0nmEPmpvnR16MUVMxOHyS41V/hLetVEG8ToNH0Osg\nYRHM9KPAfC/gAiGAO4KV6PDqv0iapNNh+vKfEO5XBcZrS7A/JnLgPMTiBEMn\nyH9Kl2XR/OJ8AhnVI0Roq1zjAYVppf6rqOdZRnlehtcBWi9j1/Z4rhx14/8G\nR6JIZK7VPoiZxYIqAhfdjR/NRDBGK84PPYiQl2dKK7he0sVAyYrP0soO00QG\nx2H7\r\n=g37y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1iy/B6CtajP8dMizamCoQhO0goaYeXt9XAo37LSuv/AiEA2k2Xxra/XTgenNyHGVZDqYwklzZojqxrp9RWzdLwVOs="}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.8_1623660474000_0.6104089459066406"},"_hasShrinkwrap":false},"1.1.9":{"name":"react-native-azure-iotcentral-client","version":"1.1.9","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"eab31a981ea1959dc30790280a15929a366c2576","_id":"react-native-azure-iotcentral-client@1.1.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-dzMuqyTtCRgRA9U39wJzBp+Q9HlrS/7F1aYfMIm5wxr+t0efm8hp99KOgyUI4yrEZE9glcDDNJjDtqVa/Os6fw==","shasum":"7de4b33f477ed44de921fe95e97df479340bcf3a","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.9.tgz","fileCount":94,"unpackedSize":321981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgx2BCCRA9TVsSAnZWagAA5TkP/38Ea9CvAWLXXesi8We9\namPbD+59k5iUQUmw4jVAHi0/kVjdYXQf6v8ZLob0CAJBVZR81zOJ3vOBGcTq\npnc+hZQf568owA0QS0+zRLFhgOyLz4DjhJUc86Uj4vJPpNQ7xMPzXsMwps4f\nRc5QCaGf+Nn//i7tY/AuFIuvJkluwBGdcslgIf3aU8wRahT7zEbH21v/i/df\nmsqKssSXjUrpfMT2GUXAeq4ifTHvucOXbWFx3gkULX4NgggIPjlxvYijiuV7\n8jIFBwcbbr3qKLIcy7TXHQo+PsbBNJYZCt9HRBKE1qPJAmf8KVUtAZG5PtkN\nhRIRN9xY2C49E6+4tADFpQuGsCMG87Hgr9vz1dHPUgWq97LePJyFfpktLOe6\nb3LQwJhn4ZOA9CBpezD1j3j3tyY3A9RbzIgqvdv+qvu3VQ8mLoZSarP/xZnh\nLByh/o7CFi73OiYXRV9dTNpLYmgm1808LkNZZKYT+5YO9qRqcs0K4KYerSrp\nsc8x6TBDfqhcfr5LFeKgdELxXyx3mW6YrCAs3rGOD8oPb7n7qPW8owOu3FVf\nXdOWzjWCGZh4NLogZKiqcoIPz8Np3JK8kKFpR03E7tzYxutzr5Fm8/noudhr\nFVZsuC5vMgkY5Cf0iH0StLePG6PP7pWVrUqy+SPPvas/cXuQsWl/97V5S0mc\nmDH0\r\n=EzCT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcKfQ8JyaYkmlC2zlLFuoP0pxL/buHhvP5uQNn5NC4VAIhAO7v+fzXyxG/D4w2BP6Q0VnMn6FltssA9CkzbHECvvcP"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.9_1623679042771_0.20350570359912767"},"_hasShrinkwrap":false},"1.1.10":{"name":"react-native-azure-iotcentral-client","version":"1.1.10","description":"IoTCentral device client for React Native","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run format && tsc","clean":"rimraf -r dist","prepublish":"npm run build","format":"prettier --write src/"},"repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"license":"MIT","bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","devDependencies":{"@types/crypto-js":"^3.1.45","@types/uuid":"^7.0.3","prettier":"^2.2.1","rimraf":"^3.0.2","typescript":"^3.9.9"},"dependencies":{"crypto-js":"^3.3.0","react-native-get-random-values":"^1.4.0","uuid":"^8.0.0","react-native-paho-mqtt":"*"},"peerDependencies":{"react-native-get-random-values":"^1.4.0","react-native-paho-mqtt":"git+https://github.com/lucadruda/react-native-paho-mqtt.git"},"publishConfig":{"registry":"https://registry.npmjs.org"},"bundleDependencies":["react-native-paho-mqtt"],"gitHead":"e434a56900010d8549ce8556524ce00571bc82d9","_id":"react-native-azure-iotcentral-client@1.1.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-nG3lwSz1h3wQZXhDFCnvHzcCe9+N22O/yFHTs19orUffy6CPI8Ee3Rx9FlblewXEdBS0NN+zRlDxXne8b1T5yA==","shasum":"9689be563e0fd51a8ed3017b0a8b0893f59e4781","tarball":"https://registry.npmjs.org/react-native-azure-iotcentral-client/-/react-native-azure-iotcentral-client-1.1.10.tgz","fileCount":94,"unpackedSize":322315,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg217hCRA9TVsSAnZWagAAU14QAJny1NDA7lMgbL7Xe8/J\nr1y1jG5J0Mqe8WFzu5uvNX7O2qdw6BAlBNafwWcrZ71mF04WrTnSvEX3ZfIj\nuoX6Wh1EVA1/uEhkZIVXXedQ8HvM24WPaXg8KmDZA5lTotsnBTU+4pAOvmf7\nLm2up/5Xjprju68q8wI6YUE2GrckmYBzx7Z1e4VOMdAtrkt13523VsKC2etI\nc2X9mXBJBQIKgqctViGje+QyW66YfzmWLaMmndqfsjR0m5sGdzByw01dnGiS\nvhEZzqz+ZlVe+6YWe/H/UfedPjIwvcgAIqI5WlFm3NFijHrsPPRWxP68IOqg\nd54khPcTnbIzWpObQA9uoJuPFZLRn+QqI/i07acYCINivDSTU/1bilP1xymE\nBbuojwet4/f3C9TEOcqaylr11zzYLPS8JXyKW9+UYf+9v6TluDcJ/um7FSIL\ngZkoaMx4ZVTr9JAq0cgddX8QCUJwpyXVjvQ2g3nY/kURLcmAuo7FChmPYZvi\ntM0cVXoSDMp25i+tG7jmRVcifee7JXPR3lgkcjkVQykbbNCbFV+U6DXffHB/\nDIryd+c7rO4VmM6c/CthSpHsps3qP7o6er2RvvMvScmkCAsOCQ+BcrjL9vbo\n39tp0pzOi8Ix1dskXhTPgNtkmy+cc3EQa56O6drH2dyoRQF5JGI0lxMvOALC\n43WV\r\n=u7NA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCvVX99bxnSflXCfSNl2kxR41wblKlkp7m9iKZsWJEeQIhAPwhd+Vb7a/Uh+/Sii/YC5YZfXc+5kWbbwd+jFwMoy47"}]},"_npmUser":{"name":"lucadruda","email":"ludruda@microsoft.com"},"directories":{},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-azure-iotcentral-client_1.1.10_1624989408839_0.6397541926153245"},"_hasShrinkwrap":false}},"time":{"created":"2020-05-13T16:30:55.092Z","1.0.0":"2020-05-13T16:30:55.202Z","modified":"2022-05-14T15:58:10.239Z","1.1.0":"2020-05-26T17:01:22.369Z","1.1.1":"2020-05-26T17:06:28.478Z","1.1.2":"2020-05-26T17:09:12.867Z","1.2.0":"2020-07-07T15:43:29.636Z","1.1.3-b.0":"2020-08-18T15:45:22.874Z","1.1.3-b.1":"2020-08-18T17:14:50.108Z","1.1.3-b.2":"2020-08-19T10:29:30.143Z","1.1.3-b.3":"2020-08-21T08:59:18.396Z","1.1.3-b.4":"2020-08-21T09:01:02.197Z","1.1.3-b.5":"2020-08-21T09:03:45.629Z","1.1.3-b.6":"2020-08-21T09:11:19.655Z","1.1.3":"2020-08-24T14:21:32.228Z","1.1.4-b.0":"2020-08-28T14:21:29.433Z","1.1.4":"2020-09-02T14:42:29.883Z","1.1.4-b.1":"2020-09-03T09:20:04.658Z","1.1.4-b.2":"2020-09-03T10:19:49.058Z","1.1.4-b.3":"2020-09-03T14:36:49.113Z","1.1.4-b.4":"2020-09-03T14:40:01.379Z","1.1.4-b.5":"2020-09-15T09:04:53.411Z","1.1.4-b.6":"2020-09-28T16:57:56.180Z","1.1.4-b.7":"2020-09-28T17:47:13.995Z","1.1.4-b.8":"2020-09-28T17:52:07.857Z","1.1.4-b.9":"2020-09-28T18:00:14.017Z","1.1.4-b.10":"2020-09-29T15:01:19.990Z","1.1.4-b.11":"2020-09-29T21:41:41.959Z","1.1.4-b.12":"2020-09-30T10:20:31.937Z","1.1.4-b.13":"2020-09-30T10:27:21.756Z","1.1.4-b.14":"2020-09-30T10:40:09.872Z","1.1.4-b.15":"2020-09-30T10:43:08.581Z","1.1.4-b.16":"2020-09-30T14:42:44.520Z","1.1.4-b.17":"2020-10-01T16:15:12.101Z","1.1.5":"2020-10-06T16:26:01.363Z","1.1.6":"2020-10-07T08:45:22.343Z","1.1.7-b.1":"2020-12-11T09:36:53.074Z","1.1.7-b.2":"2020-12-11T11:17:47.003Z","1.1.7-b.3":"2020-12-11T13:52:34.418Z","1.1.7":"2020-12-11T14:11:13.123Z","1.1.8-b.0":"2020-12-21T17:09:12.951Z","1.1.8-b.1":"2021-04-16T21:14:25.527Z","1.1.8-b.2":"2021-04-16T22:10:52.141Z","1.1.8-b.3":"2021-04-17T07:22:44.170Z","1.1.8-b.4":"2021-05-25T15:04:58.049Z","1.1.8":"2021-06-14T08:47:54.455Z","1.1.9":"2021-06-14T13:57:22.948Z","1.1.10":"2021-06-29T17:56:48.984Z"},"maintainers":[{"name":"lucadruda","email":"ludruda@microsoft.com"}],"description":"IoTCentral device client for React Native","homepage":"https://github.com/lucadruda/iotc-react-native-device-client#readme","repository":{"type":"git","url":"git+https://github.com/lucadruda/iotc-react-native-device-client.git"},"author":{"name":"Luca Druda"},"bugs":{"url":"https://github.com/lucadruda/iotc-react-native-device-client/issues"},"license":"MIT","readme":"# Azure IoTCentral device client for React Native\n\nThis project provides a react-native compatible version of the IoTCentral device client. The client is Promise-based and written in Typescript.\n\n[![npm version](https://badge.fury.io/js/react-native-azure-iotcentral-client.svg)](https://badge.fury.io/js/react-native-azure-iotcentral-client)\n\n## Getting Started\n\nInstall the package and its dependency:\n```bash\nnpm install react-native-azure-iotcentral-client react-native-get-random-values\n```\n_react-native-get-random-values_ provides a polyfill for random generated numbers. This package is mandatory and needs to be imported in project root (index.js, App,js ...);\n\n<br/>\n\n**App.js**\n\n```js\nimport 'react-native-get-random-values';\n```\n\n### Types\nSource code is written in Typescript so types are bundled with the package, you don't need to install any additional package\n\n### Connect\n\n#### Symmetric Key\n```js\nimport {IoTCClient} from 'react-native-azure-iotcentral-client';\n\nconst scopeId = 'scopeID';\nconst deviceId = 'deviceID';\nconst sasKey = 'masterKey';\n\nconst iotc = new iotCentral.IoTCClient(deviceId, scopeId, IOTC_CONNECT.SYMM_KEY,sasKey);\n\nasync function main(){\n    await iotc.connect();\n}\n\nmain();\n```\nIt is possible to use both group keys (_SYMM_KEY_) and device keys (_DEVICE_KEY_).\nWhen specifying a device key as _sasKey_ option the connection type must be _IOTC_CONNECT.DEVICE_KEY_\n\n### Operations\nAfter successfull connection, IOTC context is available for further commands.\n\nAll the callbacks are optional parameters and are triggered when message has reached the ingestion engine.\n\n### Send telemetry\n\nSend telemetry every 3 seconds\n```js\nsetInterval(async() => {\n            await iotc.sendTelemetry({\n                field1: value1,\n                field2: value2,\n                field3: value3\n            }, properties)\n```\nAn optional *properties* object can be included in the send methods, to specify additional properties for the message (e.g. timestamp, content-type etc... ).\nProperties can be custom or part of the reserved ones (see list [here](https://github.com/Azure/azure-iot-sdk-csharp/blob/master/iothub/device/src/MessageSystemPropertyNames.cs#L36)).\n\n### Send property update\n```js\nawait iotc.sendProperty({fieldName:'fieldValue'});\n```\n### Listen to property updates\n\n```js\niotc.on(IOTC_EVENTS.Properties, callback);\n\n```\nThe callback is a function accepting a Property object. Once the new value is applied, the operation must be acknoledged to reflect it on IoTCentral app.\n\n```js\niotc.on(IOTC_EVENTS.Properties, async (property) => {\n    console.log('Received '+property.name);\n    await property.ack('custom message');\n});\n\n```\n\n### Listen to commands\n```js\niotc.on(IOTC_EVENTS.Commands, callback);\n\n```\nThe callback is a function accepting a Command object. To reply, just call the reply function.\n\n```js\niotc.on(IOTC_EVENTS.Commands, async (command) => {\n    console.log('Received '+command.name);\n    await command.reply(status,'custom message');\n});\n\n```\n_status_ is of type *IIoTCCommandResponse*\n```js\nenum IIoTCCommandResponse {\n    SUCCESS,\n    ERROR\n}\n```\n\n## One-touch device provisioning and approval\nA device can send custom data during provision process: if a device is aware of its IoT Central template Id, then it can be automatically provisioned.\n\n### How to set IoTC template ID in your device\nTemplate Id can be found in the device explorer page of IoTCentral\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/modelId.jpg)\n\nThen call this method before connect():\n\n```\niotc.setModelId('<modelId>');\n```\n\n### Manual approval (default)\nBy default device auto-approval in IoT Central is disabled, which means that administrator needs to approve the device registration to complete the provisioning process.\nThis can be done from explorer page after selecting the device\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/manual_approval.jpg)\n\n\n### Automatic approval\nTo change default behavior, administrator can enable device auto-approval from Device Connection page under the Administration section.\nWith automatic approval a device can be provisioned without any manual action and can start sending/receiving data after status changes to \"Provisioned\"\n\n![Img](https://github.com/lucadruda/iotc-react-native-device-client/raw/master/assets/auto_approval.jpg)\n\n\n## Sample\nThe _sample_ folder contains a sample React Native mobile application to play with the library.\n\n<p align='center'>\n<img width='300' src='./assets/sample.gif' style='border:1px solid gray'/>\n</p>\n\n## Instructions\n\n```bash\ncd ./sample\n\nnpm install\n\n# for iOS only\ncd ./ios && pod install && cd ..\n\nnpm run ios # or 'npm run android'\n```\n\nThis sample does not use published npm package but compiled code in the parent folder. In this way you can tweak library code and easily test it through the mobile app.\nEvery time library code changes, you need to re-build and re-install package in the mobile app.\n\n```bash\nnpm run build\n\ncd ./sample\n\nnpm install\n```","readmeFilename":"README.md"}