Share a message with telegram within iOS app (Swift)

I'm developing an iOS app with swift and I need to share a message with the telegram app when a button is pressed. I want the user to choose which contact he/she wants to share the message with.

I've tried the "tg://msg?text=" schema but it only opens telegram not the sharing page to choose a contact.

Does anyone know a way for doing this?

Thank you in advance for your help !

Answer:

As @Cesare pointed out the tg://msg?text=test URL had been disabled by telegram so we need a specific phone number to share the message with.


Solution 1:

Another solution would be to use something like my LNExtensionExecutor, which allows you to bypass the UIActivityViewController and execute the standard Telegram (or any other) share extension, providing text and/or images as input items.