I’m making an attempt to assist share solutions from message conversations in my app’s Share extension. The dialog solutions appear to look on my iPad however should not showing on my iPhone or a number of different iPhone’s which I’ve examined on. The app is a common app. I adopted the directions within the Apple docs.
- The principle app data.plist comprises the suitable NSUserActivityTypes: INSendMessageIntent
- The Share Extension comprises IntentsSupported: INSendMessageIntent
- The code to donate the intent appears to be correctly working and doesn’t report any errors within the completion block.
Even a brand new challenge created with the newest model of xcode (Model 15.3 (15E204a)) appears to have the identical difficulty.
Donate intent code:
non-public func donateIntent(chatName: String, chatID: String, groupImage: INImage?) {
let groupName = INSpeakableString(spokenPhrase: chatName)
let intent = INSendMessageIntent(
recipients: nil, outgoingMessageType: .outgoingMessageText, content material: nil,
speakableGroupName: groupName, conversationIdentifier: chatID, serviceName: nil, sender: nil,
attachments: nil)
if let groupImage = groupImage {
intent.setImage(groupImage, forParameterNamed: .speakableGroupName)
}
let interplay = INInteraction(intent: intent, response: nil)
interplay.donate { error in
if let error = error {
print("Error donating intent: (error)")
} else {
print("Efficiently donated sendMessage intent.")
}
}
}