无法在React-Native中的IOS上添加共享标题

时间:2019-11-22 13:50:24

标签: react-native

我必须将Share API集成到我的应用程序中,并且在Android上可以正常运行,但是在IOS上,消息始终作为标题共享,因此忽略我在标题上添加的内容。

反应本机版本:

System:
OS: macOS Mojave 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 533.27 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.3.0 - ~/.nvm/versions/node/v8.3.0/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 5.3.0 - ~/.nvm/versions/node/v8.3.0/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.2/11B52 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4

复制步骤

  1. 在共享内容中添加标题和消息
  2. 看到在IOS上,消息总是作为标题和消息添加,并且标题根本不使用

零食,代码示例,屏幕截图或链接到存储库:

const shareContentAndroid = {
  title: productInfo,
  message: shareMessage
};
const shareContentIOS = {
  title: 'Share via',
  message: productInfo, //title
  url: null
};
let shareContent = IfAndroid(shareContentAndroid, shareContentIOS);
let shareOptions = {
  dialogTitle: 'dialog title',
  subject: 'subject'
}
Share.share(shareContent, shareOptions);

0 个答案:

没有答案