gpt4 book ai didi

ios - 共享扩展 Google Chrome - 不工作

转载 作者:行者123 更新时间:2023-11-28 21:11:33 26 4
gpt4 key购买 nike

我在让我的共享扩展程序显示在 Google Chrome 中时遇到问题。它在 Safari 中显示并运行良好,但在 Chrome 中不显示。我正在使用以下激活规则,它也适用于其他应用程序(图像、pdf、共享文本),但 chrome 缺少它。

来 self 的 info.plist:

<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>
SUBQUERY (
extensionItems,
$extensionItem,
SUBQUERY (
$extensionItem.attachments,
$attachment,
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.jpeg" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.png" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" ||
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf"
).@count == 1
).@count == 1
</string>
<key>NSExtensionJavaScriptPreprocessingFile</key>
<string>GetURL</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
</dict>

有什么想法吗?

最佳答案

关于您在Chrome中看不到自己的App shareExtension的问题,您在Chrome中看不到您的shareExtension的原因是您的NSExtensionActivationRule与Chrome不匹配。这个问题的答案与 key (NSExtensionActivationSupportsAttachmentsWithMaxCount)有关。 :P

我向您展示了我的 plist,它在 Chrome 和 Safari 中运行良好。

    <key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>2</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
<integer>0</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>

您需要做的就是将 Key - NSExtensionActivationSupportsAttachmentsWithMaxCount 的值更改为大于 1 的数字,我认为原因是 Chrome 将其数据传递给了 extensionContext!.inputItems[1] 而不是 extensionContext!.inputItems[0],您可以尝试自行设置此 Key 的不同值。

希望这能帮到你:)

关于ios - 共享扩展 Google Chrome - 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42911395/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com