diff --git a/index.js b/index.js index ac27380..ec00cb9 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ import { NativeAppEventEmitter, NativeModules } from 'react-native'; -import promisify from 'es6-promisify'; +// import promisify from 'es6-promisify'; +import Promise from 'bluebird' const WeChatAPI = NativeModules.WeChatAPI; @@ -57,7 +58,7 @@ function wrapCheckApi(nativeFunc) { return undefined; } - const promisified = promisify(nativeFunc, translateError); + const promisified = Promise.promisify(nativeFunc, translateError); return (...args) => { return promisified(...args); }; @@ -71,7 +72,7 @@ function wrapApi(nativeFunc) { return undefined; } - const promisified = promisify(nativeFunc, translateError); + const promisified = Promise.promisify(nativeFunc, translateError); return async function (...args) { if (!WeChatAPI.isAppRegistered) { throw new Error('注册应用失败'); diff --git a/package.json b/package.json index c22a7d2..d729019 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/reactnativecn/react-native-wx#readme", "dependencies": { - "es6-promisify": "^3.0.0" + "bluebird": "^3.5.0" }, "peerDependencies": { "react-native": "^0.33.0"