1

Is it possible to send files as iMessage attachments?

I would like to:

  • create a file (e.g. plist file) from an App
  • send it to another phone via iMessage
  • open it from the other phone and save it in the documents folder
  • open the app in the "other" phone (the app will look into the Documents folder and search for the saved plist file)

Alternatively I am wondering whether it is possible to save a plist file from the app to another phone (e.g. via AirDrop).

mm24
  • 9,280
  • 12
  • 75
  • 170

2 Answers2

3

Let's make clear the concept of attachment in iMessage apps.

The attachment in the iMessage context is an every kind of file you send and you let iMessage manage how to display it (you don't get any trigger when it's opened by the receiver).

To get a trigger when the receiver opens the attachment, you have to send the media file via MSMessage instance. In this way you can directly handle the tap gesture on the bubble. But there are some limitations (you can only send images, audio or videos).

In practice, there is no way, as far as I know, to achieve your expected result.

Can I ask you why you should look inside the documents folder for the plist file when the receiver taps on it?

Luca D'Alberti
  • 4,749
  • 3
  • 25
  • 45
  • He probably wants to share some App settings with other users. Documents-Folder was an example for his plist storage. Anyway, I'd go the webservice-way for this. More work in the first place but quite reliable. – Akaino Dec 15 '16 at 15:27
  • Exactly, I'd go for a backend solution too @Akaino, that's why I asked the reason – Luca D'Alberti Dec 15 '16 at 15:46
  • I wanted to avoid backend solutions. The idea of having the file/data as attachment of an iMessage should suffice. By tapping on the iMessage the user would open the app and the app will have the opportunity to read the content of the file. Sounds like that I just need to play a bit with the iMessage framework. – mm24 Dec 15 '16 at 16:08
  • @mm24 you can't actually send any file. I think in your case you can send a special URL in the `MSMessage` instance, which you can handle on the iMessage app (let's say a url like: `something://configuration?allowSomething=true`) – Luca D'Alberti Dec 15 '16 at 16:11
0

enter image description here

Conversation.insertAttachment will attach file to iMessage

Bablu Joshi
  • 379
  • 1
  • 5
  • 19