{"id":19231079,"url":"https://github.com/phodal/dore","last_synced_at":"2025-07-24T00:05:19.419Z","repository":{"id":57215262,"uuid":"114521260","full_name":"phodal/dore","owner":"phodal","description":"React Native-base  Hybrid Framework, for migrating Cordova and WebView application to React Native. ","archived":false,"fork":false,"pushed_at":"2018-01-07T14:20:49.000Z","size":2105,"stargazers_count":57,"open_issues_count":0,"forks_count":19,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-04T07:08:01.884Z","etag":null,"topics":["cordova","dore","framework","hybird","mobile","react","react-native","react-native-webiew","webiew"],"latest_commit_sha":null,"homepage":"https://phodal.github.io/dore/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phodal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-17T08:30:52.000Z","updated_at":"2024-04-20T04:49:48.000Z","dependencies_parsed_at":"2022-09-11T22:11:20.125Z","dependency_job_id":null,"html_url":"https://github.com/phodal/dore","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/phodal/dore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fdore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fdore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fdore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fdore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phodal","download_url":"https://codeload.github.com/phodal/dore/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phodal%2Fdore/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266770505,"owners_count":23981576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cordova","dore","framework","hybird","mobile","react","react-native","react-native-webiew","webiew"],"created_at":"2024-11-09T15:41:28.728Z","updated_at":"2025-07-24T00:05:19.401Z","avatar_url":"https://github.com/phodal.png","language":"JavaScript","readme":"# Dore\n\n\u003e Dore is a WebView container implemented using React Native. Help you migrate Cordova application to React Native WebView.\n\n[![npm](https://img.shields.io/npm/v/dore.svg)](https://www.npmjs.com/dore)\n\n**Dore 是一个使用 React Native 实现的 WebView 容器，可以让你在 WebView 调用 React Native 组件。**\n\n设计初衷：作为迁移 Cordova 的 WebView 应用到 React Native 的 WebView 的基础设施。\n\n**Feel free to give a pull request or issues, questions.**\n\n欢迎使用 Dore，如果你在过程中遇到问题，可以与我们联系。\n\nDemo (Ionic v1 + Angular + React Native + Dore) : see in [examples](https://github.com/phodal/dore/tree/master/examples)\n\nScreenshots:\n\n![Screenshots](./doc/demo.jpg)\n\nWorkflow:\n\n![Workflow](./doc/workflow.jpeg)\n\n微信群：\n\n![Wechat Group](./doc/wechat.jpg)\n\nFeatures\n---\n\n### Support:\n \n - AppAvailability ([react-native-check-app-install](https://github.com/redpandatronicsuk/react-native-check-app-install))\n - AppState\n - AsyncStorage\n - BackHandler (Android)\n - Badge (by [react-native-icon-badge](https://github.com/uuau99999/react-native-icon-badge)\n - Brightness （by [react-native-device-brightness](https://github.com/Calvin-Huang/react-native-device-brightness))\n - Console\n - Calender (by [react-native-calendar-events](https://github.com/wmcmahan/react-native-calendar-events))\n - Clipboard \n - DatePicker (iOS by [react-native-notag-datepicker](https://github.com/phodal/react-native-notag-datepicker))\n - DeviceInfo (by [react-native-device-info](https://github.com/rebeccahughes/react-native-device-info))\n - Flashlight ([react-native-torch](https://github.com/ludo/react-native-torch))\n - Geolocation\n - Keyboard\n - NetInfo\n - Orientation\n - Permissions (by [react-native-permissions](https://github.com/yonahforst/react-native-permissions))\n - ScreenShot (by [react-native-view-shot](https://github.com/gre/react-native-view-shot))\n - Shake (by [react-native-shake-event](https://github.com/jadsonlourenco/react-native-shake-event))\n - SMS (by [react-native-sms](https://github.com/tkporter/react-native-sms))\n - SQLite (**Test Only**,[react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage)\n - StatusBar\n - Toast (by [dore-toast](https://github.com/GrowthStudio/dore-toast))\n - Vibration\n\n### Deprecated\n\n\u003e Those plugins just list, don't plan to implement in Dore.\n\n#### UI\n\n - ActionSheet (https://github.com/EddyVerbruggen/cordova-plugin-actionsheet)\n - Camera\n - Dialog (https://github.com/apache/cordova-plugin-dialogs)\n - Feedback (https://github.com/EddyVerbruggen/nativescript-feedback)\n - QRCode\n - Share (https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin)\n\n#### no-to-works\n\n - BluetoothSerial (https://github.com/don/BluetoothSerial)\n - BLE (https://github.com/don/cordova-plugin-ble-central)\n - fs\n - NFC  \n - Push Notifications (https://github.com/zo0r/react-native-push-notification)\n - TTS (https://github.com/naoufal/react-native-speech)\n - Wechat ([RN](https://github.com/yorkie/react-native-wechat))\n - Weibo ([RN](https://github.com/reactnativecn/react-native-weibo))\n\nExample\n---\n\nsee in [examples](./examples)\n\n1.Import to your React-Native WebView\n\n```javascript\n...\nimport Toast from 'dore-toast';\nimport Orientation from 'react-native-orientation';\nimport RNIconBadge from 'dore-icon-badge'\nimport RNDeviceInfo from \"react-native-device-info\";\n\nimport Dore from 'dore';\n\nexport default class ExampleWebView extends Component {\n  ...\n  \n  constructor() {\n    super()\n    ...\n    Dore.inject([{\n      name: 'Toast',\n      class: Toast\n    }, {\n      name: 'Orientation',\n      class: Orientation\n    }, {\n      name: 'Badge',\n      class: RNIconBadge\n    }, {\n      name: 'DeviceInfo',\n      class: RNDeviceInfo\n    }])\n  }\n\n  onMessage = evt =\u003e {\n    Dore.handleMessage(evt, this.webView)\n  };\n\n  onWebViewLoadStart = () =\u003e {\n    if (this.state.isLoading) {\n      this.webView.injectJavaScript('window.isPhone = true;');\n    }\n  };\n\n  render() {\n    ...\n\n    return (\n      \u003cView\u003e\n        \u003cWebView\n          ...\n          onMessage={this.onMessage}\n        /\u003e\n      \u003c/View\u003e\n    )\n  }\n}\n```\n\n2.import [DoreClient](./client/DoreClient.js), e.x:\n\n```html\n\u003cscript src=\"js/promise.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"js/DoreClient.js\"\u003e\u003c/script\u003e\n```\n\n3.use in WebView\n\n```javascript\nDoreClient.showToast('Hello, world!')\n```\n\nAPIs\n---\n\n### AppAvailability\n\n\n| function         | return type   |    return             |\n-------------------|---------------|-----------------------|\n| isAppInstalled   |  promise      |    string             |\n| isAppInstalledAndroid  |  promise      |    string             |\n| checkURLScheme  |  promise      |    string             |\n\ninstall:\n\n```\nyarn add react-native-check-app-install\nreact-native link\n```\n\ninject:\n\n```javascript\nimport { AppInstalledChecker } from \"react-native-check-app-install\";\n\nDore.inject([{\n  name: 'AppInstalledChecker',\n  class: AppInstalledChecker\n}]);\n```\n\nexamples:\n\n```javascript\nDoreClient.checkURLScheme('whatsapp').then(function(response){\n  $scope.isAppInstalled = response;\n})\n```\n\n### App State\n\nstate value: ``active``, ``background``, ``inactive``\n\n```javascript\nDoreClient.addStateListener();\n$ionicPlatform.on('STATE', function(event) {\n  DoreClient.showToast(event.detail.data);\n});\n```\n\n### AsyncSTORAGE\n\n| function         | return type   |    return             |\n-------------------|---------------|-----------------------|\n| setAsyncStorage  |        -      |        -              |\n| getAsyncStorage  |  promise      |    string             |\n\n```javascript\n$scope.setAsyncStorage = function (key, data) {\n  DoreClient.setAsyncStorage(key, data);\n};\n\n$scope.getAsyncStorage = function (key) {\n  DoreClient.getAsyncStorage(key).then(function(response){\n    $scope.storage = response.data;\n  })\n};\n```\n\n### Back（ Android Only)\n\nexample:\n\n```javascript\n$ionicPlatform.on('ANDROID_BACK', function (event) {\n  DoreClient.showToast('ANDROID_BACK');\n});\n```\n\n### Badge\n\n| function         | return type   |    return             |\n-------------------|---------------|-----------------------|\n| setBadge         |        -      |        -              |\n| getBadge         |  promise      | { badge: 'xx' }       |\n| clearBadge       |   -           |         -             |\n\n```javascript\n$scope.getBadge = function () {\n  DoreClient.getBadge().then(function (data) {\n    $scope.badge = data.badge;\n    $scope.$apply();\n  })\n};\n$scope.setBadge = function() {\n  DoreClient.setBadge(19);\n};\n$scope.clearBadge = function() {\n  DoreClient.clearBadge();\n};\n```\n\n### Brightness\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| getBrightnessLevel   |  promise      |      float            |\n| setBrightnessLevel   |       -       |      -                |\n\n```javascript\n$scope.getBrightness = function () {\n  DoreClient.getBrightnessLevel().then(function(brightness) {\n    $scope.brightness = brightness;\n    $scope.$apply();\n  })\n};\n$scope.setBrightness = function () {\n  DoreClient.setBrightnessLevel(0.2);\n};\n```\n\n### Calendar\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| calendarAuthorizationStatus   |  promise      |  String      |\n| requestCalendarAuthorize |  -        |      -                |\n| findEventById        |  promise      |      json             |\n| fetchAllCalendar     |  promise      |      json             |\n| saveCalendar         |  promise      |      json             |\n| removeCalendar       |  promise      |      json             |\n| findCalendars        |  promise      |      json             |\n\ninstall\n\n```\nyarn add react-native-calendar-events\nreact-native link react-native-calendar-events\n```\n\ninject\n\n```\nimport RNCalendarEvents from 'react-native-calendar-events';\n\nDore.inject([{\n  name: 'Calendar',\n  class: RNCalendarEvents\n}]);\n```\n\nexamples:\n\npermissions action:\n\n```\nDoreClient.calendarAuthorizationStatus().then(function (response) {\n  $scope.authStatus = response;\n  $scope.$apply();\n});\nDoreClient.requestCalendarAuthorize();\n```\n\ncalendar actions:\n\n```  \n$scope.saveCalendar = function () {\n  DoreClient.saveCalendar(\"title\",\n    {\n      location: 'location',\n      notes: 'notes',\n      startDate: new Date().toISOString(),\n      endDate: new Date().toISOString()\n    }).then(function(response){\n      console.log(response);\n  })\n};\n$scope.findCalendars = function () {\n  DoreClient.findCalendars().then(function(response){\n    console.log(response);\n    $scope.calendars = response;\n    $scope.$apply();\n  })\n};\n$scope.fetchAllCalendar = function () {\n  DoreClient.fetchAllCalendar('2017-12-26T19:26:00.000Z',\n    '2018-01-1T19:26:00.000Z', ['1', '2']).then(function(response){\n    console.log(response);\n    $scope.fetchCalendars = response;\n    $scope.$apply();\n  })\n};\n$scope.removeFirstCalendar = function () {\n  DoreClient.fetchAllCalendar('2017-12-26T19:26:00.000Z',\n    '2018-01-1T19:26:00.000Z', ['1', '2']).then(function(response){\n    console.log(response);\n    if (response.length \u003c 1) {\n      return DoreClient.showToast(\"请先创建日历\");\n    }\n    var lastCalendar = response[0];\n    DoreClient.removeCalendar(lastCalendar.id)\n  })\n};\n$scope.findEventById = function () {\n  DoreClient.findEventById(\"297D3B27-4070-49A4-8BF9-1E7631727B4A\").then(function(response){\n    console.log(response);\n    $scope.savedCalendar = response;\n    $scope.$apply();\n  })\n};\n```\n\n### Clipboard\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| copy                 |       -       |                       |\n| paste                |      event    |  window.event         |\n\ncopy:\n\n```javascript\nDoreClient.copy($scope.text);\n```\n\npaste:\n\n```javascript\n$ionicPlatform.on('PASTE', function(event) {\n  $scope.copyText = event.detail.data;\n  $scope.$apply();\n});\nDoreClient.paste();\n```\n\n### Console ([MDN Console](https://developer.mozilla.org/en-US/docs/Web/API/Console))\n\n\u003e send WebView console to React Native\n\n```javascript\n$scope.console = console; //  can use inline console function after register\n$scope.outputSingleObject = function () {\n  var someObject = {str: \"Some text\", id: 5};\n  console.log(someObject);\n};\n$scope.outputMultipleObjects = function () {\n  var car = \"Dodge Charger\";\n  var someObject = {str: \"Some text\", id: 5};\n  var optionalParams = [car, \". The object is:\", someObject];\n  console.info(\"My first car was a\", optionalParams);\n};\n$scope.stringSubstitutions = function () {\n  for (var i = 0; i \u003c 5; i++) {\n    var optionalParams = [ \"Bob\", i + 1];\n    console.log(\"Hello, %s. You've called me %d times.\", optionalParams);\n  }\n};\n$scope.stylingConsoleOutput = function () {\n  var optionalParams = [\"color: yellow; font-style: italic; background-color: blue;padding: 2px\"];\n  console.log(\"This is %cMy stylish message\", optionalParams);\n};\n$scope.groupInTheConsole = function () {\n  console.log(\"This is the outer level\");\n  console.group();\n  console.log(\"Level 2\");\n  console.group();\n  console.log(\"Level 3\");\n  console.warn(\"More of level 3\");\n  console.groupEnd();\n  console.log(\"Back to level 2\");\n  console.groupEnd();\n  console.debug(\"Back to the outer level\");\n};\n$scope.timers = function () {\n  console.time(\"answer time\");\n  alert(\"Click to continue\");\n  console.timeEnd(\"answer time\");\n};\n$scope.stackTraces = function () {\n  function foo() {\n    function bar() {\n      console.trace();\n    }\n    bar();\n  }\n  foo();\n};\n```\n### DatePicker\n\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| showDatePicker       |    promise    |    { date: 'xx' }     |\n\n\n```javascript\nvar options = {\n  date: '2017-10-22 12:12:12',\n  maxDate: '2022-10-22 12:12:12'\n};\nDoreClient.showDatePicker(options).then(function(data) {\n  $scope.date = data.date;\n  $scope.$apply();\n});\n```\n\n### DeviceInfo\n\n| function         | return type   |    return             |\n-------------------|---------------|-----------------------|\n| getAppVersion    |  promise      | { version: 'xx' }     |\n| getUniqueID      |  promise      | { uniqueID: 'xx' }    |\n| getBrand         |  promise      | { brand: 'xx' }       |\n| getModel         |  promise      | { model: 'xx' }       |\n| getSystemName    |  promise      | { systemName: 'xx' }  |\n| isEmulator       |  promise      | boolean               |\n| isTablet         |  promise      | boolean               |\n \nexamples: \n \n```javascript\n$scope.getAppVersion = function() {\n  DoreClient.getAppVersion().then(function(data) {\n    $scope.version = data.version;\n    $scope.$apply();\n  });\n};\n$scope.isTablet = function() {\n  DoreClient.isTablet().then(function(data) {\n    $scope.isTablet = data;\n    $scope.$apply();\n  });\n};\n```\n\n### Flashlight\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| onFlashlight         |     -         |       -               |\n| offFlashlight        |     -         |       -               |\n\ninject\n\n```javascript\nimport Torch from 'react-native-torch';\n\nDore.inject([{\n  name: 'Flashlight',\n  class: Torch\n}]);\n```\n\nusage\n\n```javascript\n$scope.onFlashlight = function () {\n  DoreClient.onFlashlight();\n};\n$scope.offFlashlight = function () {\n  DoreClient.offFlashlight();\n}\n```\n\n### Geolocation\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| getCurrentPosition   |    promise    |         json          |\n| watchPosition        |    event      |         event         |\n| clearWatch           |       -       |           -           |\n| stopObserving        |       -       |           -           |\n\n```javascript\n$scope.getCurrentPosition = function() {\n  DoreClient.getCurrentPosition().then(function(data) {\n    $scope.location = data;\n    $scope.$apply();\n  });\n};\n\n$scope.watchPosition = function() {\n  $ionicPlatform.on('WATCH_POSITION', function(event) {\n    $scope.wPosition = event.detail.data;\n    $scope.$apply();\n  });\n  DoreClient.watchPosition();\n};\n\n$scope.clearWatch = function() {\n  DoreClient.clearWatch();\n};\n$scope.stopObserving = function() {\n  DoreClient.stopObserving();\n};\n```\n\n### Keyboard\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| hideKeyboard         |     -         |     -                 |\n\n```javascript\nDoreClient.hideKeyboard();\n````\n\n### NetInfo\n\n| function                    | return type   |    return             |\n------------------------------|---------------|-----------------------|\n| getConnectionInfo           |    promise    |     json              |\n| addNetInfoEventListener     |     event     |     event             |\n| removeNetInfoEventListener  |     -         |     -                 |\n\n```javascript\n$scope.getConnectionInfo = function() {\n  DoreClient.getConnectionInfo().then(function(data) {\n    $scope.connectionInfo = data;\n    $scope.$apply();\n  });\n};\n$scope.addEventListener = function() {\n  $ionicPlatform.on('CONNECTION_CHANGE', function(event) {\n    $scope.wConnectionInfo = event.detail.data;\n    $scope.$apply();\n  });\n  DoreClient.addNetInfoEventListener();\n};\n$scope.removeEventListener = function() {\n  DoreClient.removeNetInfoEventListener();\n};\n```\n\n### Orientation\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| getOrientation       |     promise   |    string             |\n| lockToLandscape      |        -      |     -                 |\n| lockToPortrait       |        -      |     -                 |\n\n```javascript\n$scope.lockToLandscape = function() {\n  DoreClient.lockToLandscape();\n};\n$scope.lockToPortrait = function() {\n  DoreClient.lockToPortrait();\n};\n$scope.getConnectionInfo = function() {\n  DoreClient.getConnectionInfo().then(function(data) {\n    $scope.connectionInfo = data;\n    $scope.$apply();\n  });\n};\n```\n\n### Permissions\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| checkPermissions     |     promise   |      JSON             |\n| requestPermissions   |     promise   |      JSON             |\n| checkMultiple        |     promise   |      JSON             |\n\n```javascript\n$scope.checkPermissions = function () {\n  DoreClient.checkPermissions('camera').then(function(response) {\n    DoreClient.showToast(JSON.stringify(response));\n  })\n};\n$scope.requestPermissions = function () {\n  DoreClient.requestPermissions('camera').then(function(response) {\n    DoreClient.showToast(JSON.stringify(response));\n  })\n};\n$scope.checkMultiple = function () {\n  DoreClient.checkMultiple(['camera', 'photo']).then(function(response) {\n    DoreClient.showToast(JSON.stringify(response));\n  })\n};\n```\n\n### Screenshot\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| captureScreen        |     string    |     URI               |\n\n\ninstall: \n\n```\nyarn add react-native-view-shot\nreact-native link react-native-view-shot\n```\n\ninject:\n\n```javascript\nimport { captureScreen } from \"react-native-view-shot\";\n\nDore.inject([{\n  name: 'Capture',\n  class: captureScreen\n}]);\n```\n\nUsage\n\n```javascript\nDoreClient.captureScreen().then(function(response) {\n  \n})\n```\n\n### SMS\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| sendSMS              |     event     |       event           |\n\nInstall:\n\n```\nyarn add react-native-sms\nreact-native link react-native-sms\n```\n\nInject\n\n```javascript\nimport SendSMS from 'react-native-sms';\n\nDore.inject([{\n  name: 'SMS',\n  class: SendSMS\n}]);\n```\n\nExamples:\n\n```javascript\n$scope.sendSMS = function () {\n  DoreClient.sendSMS({\n    body: 'Hello, world',\n    recipients: ['10086']\n  });\n}\n```\n\n### StatusBar\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| hideStatusBar        |     -         |       -               |\n| showStatusBar        |     -         |       -               |\n\n```javascript\nDoreClient.hideStatusBar();\nDoreClient.showStatusBar();\n```\n\n### Shake\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| addShakeListener     |     event     |       -               |\n| removeShakeListener  |     -         |       -               |\n\n```javascript\n$ionicPlatform.on('SHAKE', function (response) {\n  $scope.shake = response.detail.data;\n  $scope.$apply();\n});\nDoreClient.addShakeListener();\n```\n\nDone:\n\n```javascript\nDoreClient.removeShakeListener();\n```\n\n\n### Toast\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| show                 |     -         |       -               |\n\n``DoreClient.showToast(String,  duration: short | long ,  position: 'center' | 'top')``\n\n```javascript\nDoreClient.showToast('this is a toast');\n\nDoreClient.showToast('this is a toast', 'long', 'center');\n```\n\n### Vibration\n\n\n| function             | return type   |    return             |\n-----------------------|---------------|-----------------------|\n| vibrate              |     -         |       -               |\n| show                 |     -         |       -               |\n\n```javascript\nDoreClient.vibrationVibrate(1000);\n\nDoreClient.vibrationCancel();\n```\n\n\n### SQLite(Test functional)\n\n```javascript\n\nfunction operationDataBase(webview, db) {}\nfunction errorCB(error) {}\n\nvar SQLite = DoreClient.SQLite;\n      SQLite.open(\n        'test.db',\n        '1.0',\n        'SQLite test databases',\n        200000,\n        operationDataBase,\n        errorCB)\n        .then(function (payload) {\n          console.log('open then');\n          console.log(payload);\n          alert(JSON.stringify(payload))\n        })\n        .catch(function (err) {\n          console.log(err)\n        })\n    };\n\n```\n\nDevelopment\n---\n \nWorkflow: DoreClient：**Browser -\u003e vibrationVibrate -\u003e DoreClient -\u003e window.postMessage -\u003e RN**\n\nDoreClient, handle message in WebView\n\nBrowser\n\n```javascript\n$scope.vibrationVibrate = function () {\n  DoreClient.vibrationVibrate([1000, 2000, 3000]);\n};\n```  \n\nDoreClient\n\n```javascript\nfunction invoke(action, payload) {\n  function postMessage(action, payload) {\n    var message = JSON.stringify({\n      action: action,\n      payload: payload\n    });\n    window.postMessage(message, '');\n  }\n}\n\nDoreClient = {\n  vibrationVibrate: function (duration) {\n    return invoke('VIBRATION', {type: 'VIBRATE', duration: duration});\n  }\n}\n```\n\nWorkflow: Dore: WebView -\u003e onMessage -\u003e Dore -\u003e xxxBridge -\u003e Native\n\nDore, handle message in React Native\n\nWebView\n\n```javascript\nonMessage = evt =\u003e {\n  Dore.handleMessage(evt, this.webView)\n};\n```\n\nDore\n\n```javascript\nDore.handleMessage = (event, webView) =\u003e {\n  const action = eventData.action;\n  switch (action) {\n    case 'VIBRATION': {\n      return VibrationBridge(payload)\n    }\n  }\n}\n```\n\nBridge\n\n\n```javascript\nimport { Vibration } from 'react-native';\n\nlet VibrationBridge = (payload) =\u003e {\n  if (payload.type === 'VIBRATE') {\n    if (!payload.options) {\n      return Vibration.vibrate(500)  // is duration is fixed time (about 500ms)\n    }\n\n    if (Number.isInteger(payload.duration) || payload.duration.length \u003e 0) {\n      return Vibration.vibrate(payload.duration)\n    }\n  } else if (payload.type === 'CANCEL') {\n    Vibration.cancel();\n  }\n};\n```\n\nLicense\n---\n\n[![Phodal's Idea](http://brand.phodal.com/shields/idea-small.svg)](http://ideas.phodal.com/)\n\n© 2017 A [Phodal Huang](https://www.phodal.com)'s [Idea](http://github.com/phodal/ideas).  This code is distributed under the MIT license. See `LICENSE` in this directory.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphodal%2Fdore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphodal%2Fdore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphodal%2Fdore/lists"}