Monday, April 29, 2024
HomeiOS Developmentios - Donated INSendMessageIntent just isn't displaying in Share Extension

ios – Donated INSendMessageIntent just isn’t displaying in Share Extension


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.

Essential App data.plist
enter image description here

Share Extension data.plist
enter image description here

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.")
        }
    }
}



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments