“This item cannot be shared. Please select a different item.” WhatsApp iOS share extension failure message

前端 未结 7 595
长情又很酷
长情又很酷 2020-12-08 02:15

This bug is fixed by WhatsApp team on 23rd May, 2016 (build no. 2.16.4).

Unable to share NSString object using UIActivityViewControll

7条回答
  •  伪装坚强ぢ
    2020-12-08 02:53

    Ran into this problem with a custom UIActivityItemSource where I was passing back kUTTypeData that most providers understand for the dataTypeIdentifierForActivityType delegate method instead of kUTTypeText. Simple case overrides fixed the issue in my case. Just another reason the error above could be popping if anyone sees it.

    open func activityViewController(_ activityViewController: UIActivityViewController, dataTypeIdentifierForActivityType activityType: UIActivityType?) -> String {
        switch activityType {
        case UIActivityType(rawValue: "net.whatsapp.WhatsApp.ShareExtension"):
            return kUTTypeText as String
        default:
            return kUTTypeData as String
        }
    }
    

提交回复
热议问题