diff --git a/README.md b/README.md index a9e07d3..06a37a1 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,30 @@ protected List getPackages() { -framework "JMessage" ``` +#### 使用Autolink + +``` +yarn add jmessage-react-plugin +touch react-native.config.js +cd ios +pod install +``` +在刚刚创建的react-native.config.js文件(位于项目根目录)中,粘贴下面的内容 +``` +module.exports = { + dependencies: { + 'jmessage-react-plugin': { + platforms: { + android: { + packageInstance: 'new JMessageReactPackage(false)' + } + } + }, + } +}; +``` +注意:上面的初始化参数,是true还是false,根据你自己的需要填入即可 +然后按照上面的配置说明进行配置即可使用 ## API diff --git a/ios/RCTJMessageModule/RCTJMessageModule.m b/ios/RCTJMessageModule/RCTJMessageModule.m index 45575fe..2d58a0e 100644 --- a/ios/RCTJMessageModule/RCTJMessageModule.m +++ b/ios/RCTJMessageModule/RCTJMessageModule.m @@ -53,6 +53,11 @@ - (id)init { return self; } ++ (BOOL)requiresMainQueueSetup +{ + return YES; +} + - (void)setBridge:(RCTBridge *)bridge { _bridge = bridge; JMessageHelper.shareInstance.launchOptions = _bridge.launchOptions; diff --git a/package.json b/package.json index 52e9178..97db605 100644 --- a/package.json +++ b/package.json @@ -20,27 +20,6 @@ "peerDependencies": { "jcore-react-native": ">= 1.2.11" }, - "rnpm": { - "ios": { - "sharedLibraries": [ - "libz", - "UserNotifications", - "CoreTelephony", - "Security", - "CFNetwork", - "CoreFoundation", - "SystemConfiguration", - "Foundation", - "UIKit", - "libresolv", - "CoreGraphics", - "CoreAudio", - "AudioToolbox", - "MobileCoreServices", - "libsqlite3" - ] - } - }, "homepage": "https://github.com/jpush/jmessage-react-plugin#readme", "dependencies": { "jcore-react-native": ">=1.3.1"