1

Does anyone know if it is possible to access the title of a shared item in a share extension. I know that it is possible to get title and some other attributes by JavaScript. The problem is I want to get the title of items shared from the YouTube App for example. In the Image below it would be the string "Welcome G2.."

Thanks for your help.

enter image description here

Secondwave
  • 225
  • 1
  • 4
  • 17

1 Answers1

1

I believe it is only possible by supplying URL as shared item to the UIActivityViewController. The header will configure itself with appropriate icon, title and domain. It looks like the example you have provided, YouTube app, uses exactly that.

UPDATE: to retrive title you can use URLSession, try this approach.

Witek Bobrowski
  • 3,749
  • 1
  • 20
  • 34
  • Thanks for the answer. My problem is not to configure the title, I want to access the title in a share extension. – Secondwave Nov 25 '20 at 10:59
  • It is present in the `inputItems[0].userInfo[NSExtensionItemAttributedContentTextKey]` when there is only 1 attachment and that attachment is URL – user1046037 Nov 22 '21 at 01:03