+ (UIPasteboard *)pasteboardWithName:(UIPasteboardName)pasteboardName create:(BOOL)create;
Return Value
A pasteboard object that can be used for transferring data within an app or between apps that have the same team ID.
官方文档说明,有相同的team ID的app之间可以共享剪贴板。本地测试的确正常,但CI构建出来的企业签名版本,获取到的就是nil。我们自己重签名一下,发现又可以正常获取。
我们使用 security cms -D -i "Payload/YourApp.app/embedded.mobileprovision"
对比了一下签名,怀疑是可能和 application-identifier 有关,CI上签发的这个值带有通配符。
只是怀疑,不能100%确定。苹果最近代码质量严重下降,bug超多,反正我已绕开这个方法。