{"_id":"@aurora-org/react-native-xupdate-typescript","_rev":"3-c001db7643e91d355158611e25691c4a","name":"@aurora-org/react-native-xupdate-typescript","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@aurora-org/react-native-xupdate-typescript","description":"A React-Native plugin for XUpdate(Android Version Update Library).","version":"1.0.0","main":"index.js","scripts":{"test":"make test"},"keywords":["react-native","xupdate","native"],"repository":{"type":"git","url":"git+https://github.com/alazypig/react-native-xupdate-typescript.git"},"author":{"name":"Edward","email":"wang.huiyang@outlook.com","url":"http://alazypig.github.io"},"bugs":{"url":"https://github.com/alazypig/react-native-xupdate-typescript/issues"},"license":"Apache-2.0","devDependencies":{"react-native":"^0.61.5"},"homepage":"https://github.com/alazypig/react-native-xupdate-typescript#readme","gitHead":"e8c40927cddf3cc66445ed0d0eb22b751a57ab35","_id":"@aurora-org/react-native-xupdate-typescript@1.0.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-TRDhbksFOuHiTA+oBxTq+Hj4iOsfPnj6AqXPMZSgXGofbDiYBQ3YnnJ1ENuw0L8VtiMU3jZuDFDl2H9CiNIx1A==","shasum":"c50bb8493524449d3fe4803e02c6873bf10a9271","tarball":"https://registry.npmjs.org/@aurora-org/react-native-xupdate-typescript/-/react-native-xupdate-typescript-1.0.0.tgz","fileCount":15,"unpackedSize":53333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxKBBCRA9TVsSAnZWagAAGqEP/17CRmWCUaw3A7qB1JIH\nEwznGgllE/5eCD4MopWrTSOevsH2/mssMD5tTiSs/BGbVO6w3FRwxJCpuY5b\nSfVn+sCyAWY2qtNRjIx7WCFckzp/9uF5eMoe4orDzU2SjOdhje6K7VVgChiu\nemNaccpaQFgiO/IYzztzAQe1Tb4Jh7nt+CgGiOS6zMqW4fdKfSNU50j6djuq\n4sX9hSqkgUVBGKCT2NCKljYimMjxSzZ72wlmzsOpR1Uz5g8ISR1te/FNA/df\nUnKyuFC2XHtYUwhQYYT9kXJfbebtP0pvPx6p08VZ3y1yIby9pY4HWDWX0ma9\nnyJH6mQ2eSF1FvwYHyCTNiRRTzpQyGL4hMYdCsSufdx7ITBcKMHi4qEBi79a\n7DrKBCGfDAAKRipIpb4+V2CvdO0gQJ4XK1O5M9V+1oI0uZIfd6nrCSmvPMZG\nAOElPFYqWDEOeJiJFCt15myUU6XKNJqMR9AG29aldDzzoteBupxu/qZF5hnL\nxltTd5l5S/oDunpnn00T+tWqrzoKVZ8LZi+3e6+I7Nxs1dOZRsnY1TJyllvw\nteovqYCzVrg6koXEzI0sWqnafAc+CvPatTnanPXviJ3yxpJa/u/T1RRcj7uH\nGAYQRO00prYlwEFskrL56SInYVezKS1vlNcD2WbIP7T08iEmnT75zV52H2xC\n15nS\r\n=tN5W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8p8/RzzoRmJ7P9G9+1S+qu9BoHBRukN5BOt13NONcwAIgGouwpmH09VouCGS/QrKtWQCHfBQVGjfS7Ba5wQUlSsU="}]},"_npmUser":{"name":"alazypig","email":"wang.huiyang@outlook.com"},"directories":{},"maintainers":[{"name":"alazypig","email":"wang.huiyang@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-xupdate-typescript_1.0.0_1606721601166_0.40779676695896083"},"_hasShrinkwrap":false},"1.0.1":{"name":"@aurora-org/react-native-xupdate-typescript","description":"A React-Native plugin for XUpdate(Android Version Update Library).","version":"1.0.1","main":"index.js","scripts":{"test":"make test","publish":"publish @aurora-org/react-native-xupdate-typescript --access=public"},"keywords":["react-native","xupdate","native"],"repository":{"type":"git","url":"git+https://github.com/alazypig/react-native-xupdate-typescript.git"},"author":{"name":"Edward","email":"wang.huiyang@outlook.com","url":"http://alazypig.github.io"},"bugs":{"url":"https://github.com/alazypig/react-native-xupdate-typescript/issues"},"license":"Apache-2.0","devDependencies":{"react-native":"^0.61.5"},"homepage":"https://github.com/alazypig/react-native-xupdate-typescript#readme","gitHead":"e53c6eb18d1d4acf96231903728a845056ad5445","_id":"@aurora-org/react-native-xupdate-typescript@1.0.1","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-lInAPumzUJ/Vua4WkbkWVt9ynxvuqmnjGoqddErKSl2WUsnHTdVOmFm9geuBHBL+VANqQQ8FM9kaRQp3EG4EjA==","shasum":"62c758ef1f69c8ad7597f84926c61c8e5d4c81f6","tarball":"https://registry.npmjs.org/@aurora-org/react-native-xupdate-typescript/-/react-native-xupdate-typescript-1.0.1.tgz","fileCount":15,"unpackedSize":52056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxgrvCRA9TVsSAnZWagAA6uUQAJYoaJiq/WFmh5k08pMv\nuGGq4GL/H5CrWXOUrChrz9vALVyD4hdAhbQLjMfSWtMh00GGinDclFtwaNh6\nJt2iQ/N++bYQNr7vScob3VNM29cfUNfijolnhSw0KmJSZxhaPWbgy23ebpvr\nD6SRjmWC9PUI7MAefSFhE/1lZFgscVZ6Wj5g4wRjzXmScs1ZyJg5XSW54Vr2\n7+KSi7Qx5nnvp4uTu6P3IHoVwz97UJOwQ6MJvMnMjSPiDi/O4O0rmOHLt/p+\nFvhg0B/RWrfqGbAfElM73+X9Df7b6XKSgDNBn/CSWXbOz4nk2/xlXXSdVWVy\n0TtSX1yur4fagBamqyu/He2ay5Hj0epjd3MnBEDcwyyFIZQVUC+Cwuim/BXZ\n/HbQ17TBy0yrqkosK9pcyW2JVLI6ed6ui4w1jz2+6IBWLWxact3AEJIkAqp5\nnRABIAmDiSEnmWF8NUVq6ByPcv5GpQbwdnf0GE8GxhoEFfI5zKzcu2TNLdvy\nsJWtJLBiANsEB15KBDkvIMgNGYg2ANul256A8+qt3ZNyoXNN8H6XgrFYt6O/\nR4orezJlgeK4mOMMH6w5TvWSGYznGmQI4w2x6pjwRfe7nROTR9JWIOiaNJ1R\n+zlrkpYkmutwoCeu0NYv4BGoOqKi9toxrnmNzVtHSOcoLYJVxFoSAXkWWfUX\nZ898\r\n=Kkj8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICF1J84HGGc7RnIB8/y5TWCpZbZ2P+bsK3+n7/zZnRS0AiEAsYMW/QKeQPysEtH+eQzB2efAidt/OGLbv/8EjCQAGiE="}]},"_npmUser":{"name":"alazypig","email":"wang.huiyang@outlook.com"},"directories":{},"maintainers":[{"name":"alazypig","email":"wang.huiyang@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-xupdate-typescript_1.0.1_1606814447341_0.125976935340256"},"_hasShrinkwrap":false},"1.1.0":{"name":"@aurora-org/react-native-xupdate-typescript","description":"A React-Native plugin for XUpdate(Android Version Update Library).","version":"1.1.0","main":"index.js","scripts":{"test":"make test"},"keywords":["react-native","xupdate","native"],"repository":{"type":"git","url":"git+https://github.com/alazypig/react-native-xupdate-typescript.git"},"author":{"name":"Edward","email":"wang.huiyang@outlook.com","url":"http://alazypig.github.io"},"bugs":{"url":"https://github.com/alazypig/react-native-xupdate-typescript/issues"},"license":"Apache-2.0","devDependencies":{"react-native":"^0.61.5"},"homepage":"https://github.com/alazypig/react-native-xupdate-typescript#readme","gitHead":"fcf2da158a79ea200fa0639e8dcb27a188664842","_id":"@aurora-org/react-native-xupdate-typescript@1.1.0","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-ronKgzWOgB3DjKqO4oeJ32UYes/R2fNeuc0hYfxU84cAw1nxDSB0PibJRwRhMe8LMJXMXDU8/SWbgYPrxuuWrg==","shasum":"897543569a85d402ca305411f81f95d8f9d5dc56","tarball":"https://registry.npmjs.org/@aurora-org/react-native-xupdate-typescript/-/react-native-xupdate-typescript-1.1.0.tgz","fileCount":15,"unpackedSize":51972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxg1UCRA9TVsSAnZWagAAfTMQAIhjlNsvc36a/PkodARn\nZr3geiWNuf6YeuWAYHi7fHCfS8Da98CpT+g7c+7mxNHvAOrnSbJWSrPv6Y+b\nXG6hLNwMJmCDAZ0857JXJBjwcnq+RLYWQsU+ljsI5cAeSL5l8fnYaMqKrzKI\n81CGNsfn4t+dii5ER0GphMwHP820ynwIsQDx2lXGR5gVyhbUg7npIK7X1KdT\nLV+UWGT/ITl5eE6L/2KWdEomPox7PWfMFVq0XXaflWR5VftDX/CsnsqCIdaB\n9HYCyUVKVjjEbN+gaw3CHKeAxU4p2VcW410PJdInJpLlZImzYJcgQYTEViLk\nq2EYGBaPaqtLC3m8OxEnige0zaZoTkpzdHdGKFFmVQcZ2kvIqt4diNOibM79\n6NBxV1HAoiCBl+chKuSZr/wB/eZm9E8KhpxyHSWVVVWl9TqSqtf/gr0XvJa6\nAx9UiI/q7HDNaAXdE6UIvIRVfcnRh3MYPSI3bgSh74rXwpX0cfyFtcgTyevC\nOMMqWELoE24EAAr+wZgUbyEsnWXoen7JMnSUWFDK4gnk5NtR9J30hwunc6QX\nzBWzsSH3/cpdoOk1B9D/+yZL79Uu0Es5z0/BkXPCHt/Dkg1Z7N5D/hqigP2i\n23iveFUU2VCNYNxeTtNIZ2+Tc6mT9Dq+n3cm5NMMDeIc8as14CMZJ9uXi0Hz\nFCn5\r\n=DRYA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd0DWw0k4K3ECGmqFNUD5dgcinUWQD+xHy6jZeyQEq/QIhAJXRTZDYjkk5htIKd5ItTT7UD5dVuwBObHgnw3kT4Ncr"}]},"_npmUser":{"name":"alazypig","email":"wang.huiyang@outlook.com"},"directories":{},"maintainers":[{"name":"alazypig","email":"wang.huiyang@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-xupdate-typescript_1.1.0_1606815060057_0.15364491029095517"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-30T07:33:20.885Z","1.0.0":"2020-11-30T07:33:21.278Z","modified":"2022-04-04T16:28:11.147Z","1.0.1":"2020-12-01T09:20:47.513Z","1.1.0":"2020-12-01T09:31:00.221Z"},"maintainers":[{"name":"alazypig","email":"wang.huiyang@outlook.com"}],"description":"A React-Native plugin for XUpdate(Android Version Update Library).","homepage":"https://github.com/alazypig/react-native-xupdate-typescript#readme","keywords":["react-native","xupdate","native"],"repository":{"type":"git","url":"git+https://github.com/alazypig/react-native-xupdate-typescript.git"},"author":{"name":"Edward","email":"wang.huiyang@outlook.com","url":"http://alazypig.github.io"},"bugs":{"url":"https://github.com/alazypig/react-native-xupdate-typescript/issues"},"license":"Apache-2.0","readme":"# react-native-xupdate\n\n[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://www.npmjs.com/package/@aurora-org/react-native-xupdate-typescript)\n[![Issue](https://img.shields.io/github/issues/alazypig/alazypig-react-native-xupdate-typescript.svg)](https://github.com/alazypig/alazypig-react-native-xupdate-typescript/issues)\n[![Star](https://img.shields.io/github/stars/alazypig/alazypig-react-native-xupdate-typescript.svg)](https://github.com/alazypig/alazypig-react-native-xupdate-typescript)\n\nA React-Native plugin for XUpdate(Android Version Update Library).\n\n## Getting started\n\n`$ npm install @aurora-org/react-native-xupdate-typescript --save`\n\n### Mostly automatic installation\n\nReact Native after 0.60 will autolinked modules.\n\n<s>`$ react-native link @aurora-org/react-native-xupdate-typescript`</s>\n\n### Manual installation\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n\n- Add `import com.xuexiang.xupdate.RNXUpdatePackage;` to the imports at the top of the file\n\n<s>2. Append the following lines to `android/settings.gradle`:</s>\n\n```gradle\ninclude ':@aurora-org/react-native-xupdate-typescript'\nproject(':@aurora-org/react-native-xupdate-typescript').projectDir = new File(rootProject.projectDir, \t'../node_modules/@aurora-org/react-native-xupdate-typescript/android')\n```\n\n<s>3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:</s>\n\n```\ncompile project(':@aurora-org/react-native-xupdate-typescript')\n```\n\n## Usage\n\nOnly use for Android.\n\n### Initialization\n\n```javascript\nimport {XUpdate} from '@aurora-org/react-native-xupdate-typescript';\n\n//Initialization\ninitXUpdate() {\n    let args = new InitArgs();\n    args.debug = true;\n    args.isPostJson = false; // post json\n    args.isWifiOnly = false;\n    args.isAutoMode = false;\n    args.supportSilentInstall = false; // need root privileges\n    args.enableRetry = false;\n\n    //Initialize SDK\n    XUpdate.init(args).then(result => {\n        this.setState({\n            _message: 'Initialize success:' + JSON.stringify(result),\n        });\n    }).catch(error => {\n        console.log(error);\n        this.setState({\n            _message: 'Initialize failed:' + error,\n        });\n    });\n\n    XUpdate.setCustomParser({parseJson: this.customParser});\n    XUpdate.addErrorListener(this.errorListener);\n}\n```\n\n### JSON Format\n\n```json\n{\n  \"Code\": 0, // 0: success, other: failed\n  \"Msg\": \"\", // error message\n  \"UpdateStatus\": 1, // 0: no update, 1: non-mandatory update, 2: mandatory update\n  \"VersionCode\": 3,\n  \"VersionName\": \"1.0.2\",\n  \"ModifyContent\": \"\",\n  \"DownloadUrl\": \"\",\n  \"ApkSize\": 2048,\n  \"ApkMd5\": \"...\" // required\n}\n```\n\n### CheckUpdate\n\n```javascript\n    checkUpdateDefault() {\n        let args = new UpdateArgs(_updateUrl);\n        XUpdate.update(args);\n    }\n\n    checkUpdateSupportBackground() {\n        let args = new UpdateArgs(_updateUrl);\n        args.supportBackgroundUpdate = true;\n        XUpdate.update(args);\n    }\n\n    checkUpdateRatio() {\n        let args = new UpdateArgs(_updateUrl);\n        args.widthRatio = 0.6;\n        XUpdate.update(args);\n    }\n\n    // mandatory update\n    checkUpdateForce() {\n        let args = new UpdateArgs(_updateUrl2);\n        XUpdate.update(args);\n    }\n\n    // need root privileges\n    checkUpdateAutoMode() {\n        let args = new UpdateArgs(_updateUrl);\n        args.isAutoMode = true;\n        XUpdate.update(args);\n    }\n\n    enableChangeDownLoadType() {\n        let args = new UpdateArgs(_updateUrl);\n        args.overrideGlobalRetryStrategy = true;\n        args.enableRetry = true;\n        args.retryContent = 'Switch to another site?';\n        args.retryUrl = 'https://example.com/test.apk';\n        XUpdate.update(args);\n    }\n\n    showRetryDialogTip() {\n        XUpdate.showRetryUpdateTip('content', 'url');\n    }\n```\n\n### Custom JSON Format\n\n1.Setting up a custom update parser\n\n```javascript\nXUpdate.setCustomParser({parseJson: this.customParser})\n\ncustomParser = (json) => {\n  let appInfo = JSON.parse(json)\n  return {\n    // required\n    hasUpdate: appInfo['hasUpdate'],\n    versionCode: appInfo['versionCode'],\n    versionName: appInfo['versionName'],\n    updateContent: appInfo['updateLog'],\n    downloadUrl: appInfo['apkUrl'],\n\n    // optional\n    isIgnorable: appInfo['isIgnorable'],\n    apkSize: appInfo['apkSize'],\n  }\n}\n```\n\n2.Set the parameter `isCustomParse` to true\n\n```javascript\ncustomJsonParse() {\n    let args = new UpdateArgs(_updateUrl3);\n    args.isCustomParse = true;\n    XUpdate.update(args);\n}\n```\n\n### Update By UpdateEntity Directly\n\n```javascript\ncheckUpdateByUpdateEntity() {\n    let args = new UpdateArgs();\n    args.supportBackgroundUpdate = true;\n    XUpdate.updateByInfo(args, {\n        // required\n        hasUpdate: AppInfo['hasUpdate'],\n        versionCode: AppInfo['versionCode'],\n        versionName: AppInfo['versionName'],\n        updateContent: AppInfo['updateLog'],\n        downloadUrl: AppInfo['apkUrl'],\n\n        // optional\n        isIgnorable: AppInfo['isIgnorable'],\n        apkSize: AppInfo['apkSize'],\n    });\n}\n```\n\n### Custom Update Prompt Style\n\n> Currently, only theme color and top picture customization are supported!\n\n1.Configure top picture, Path: `android/app/src/main/res/values/drawable`\n\n2.Set the parameter `themeColor` and `topImageRes`\n\n```javascript\ncustomPromptDialog() {\n    let args = new UpdateArgs(_updateUrl);\n    args.themeColor = '#FFFFAC5D';\n    args.topImageRes = 'bg_update_top';\n    XUpdate.update(args);\n}\n```\n","readmeFilename":"README.md"}