george
george

Reputation: 163

iMessage API, accessing texts not sent through your app

I'm looking for a way to detect if links have been shared in an iMessage conversation. I'm not sure if this can be done with MSMessage, as it looks like it only receives events from messages created by your iMessage app.

Does this mean there is no way to access the conversation outside of the scope of messages created by your iMessage app? Any help is very much appreciated!

Upvotes: 0

Views: 559

Answers (2)

RomOne
RomOne

Reputation: 2105

At the moment you can only access messages that come from your app AND :

  • that were selected by the user. Meaning that any previous message sent via your app won't be accessible unless the user tap it.

  • that were received during the app runs

Note that we are only at the third beta test (at the moment I'm writing) of that new feature. As an "enhancement" were open for this feature, apple developers may allow an app to access messages (of course messages sent via this app, Apple is really worry about all that confidentiality stuff ;) ) in the future

Upvotes: 1

Andrew
Andrew

Reputation: 15377

Your suspicion is correct. You can only access your own extension's messages.

Quote from the documentation for MSMessagesAppViewController.didReceive(_:conversation:):

You only receive notifications about messages sent using your extension. You cannot interact with messages from other extensions.

Upvotes: 1

Related Questions