digidem / comapeo-mobile

The next version of Mapeo mobile
GNU General Public License v3.0
5 stars 1 forks source link

Whatsapp - Sharing Obvs w Audio -doesnt share audio #812

Closed ximenabb closed 1 week ago

ximenabb commented 4 weeks ago

https://www.notion.so/digidem/Whatsapp-Sharing-Obvs-w-Audio-doesnt-share-audio-1371b08162d5807d8883eb42714e328a?pvs=4

ErikSin commented 1 week ago

I spent a quite a while looking into this and trying to solve the issue. There are some really annoying complications and the two viable options are still not ideal

The issue:

We use a sharing library called React-Native-Share. This is used to interface with other messaging apps such as telegram and whats app, and sends the appropriate info (photos, message, and audio). If you go on whats app, you have the choice to send a photo OR and audio file. You cannot send both. Techincally you can choose to send "files" on whatsapp. And this allows you to chose a photo and audio file, but these are being sent as files that the recipient has to download, but they are unable to see the photo or listen to the audio file directly in the message.

Based on this, I think what is happening is that whatsapp is unable to process both the audio file and the photos file when it recieves both. In an ideal world it would just treat them as "files" and send both, forcing the user to download both of them. But it is not, and therefore it is just choosing to send neither.

This is particularly annoying because it is not happening on any other platform (eg, email, telegram, slack).

The other annoying part of this is we cant intercept whatsapp only messages. In otherwords, Once the user presses the share button, the share library takes over. So we cant wait for the user to choose whats app, and then present a message asking them if they only want to share audio or if they only want to share photos. We have to ask them BEFORE they are prompted to share

We could ask if they only want to share photos or audio before. But if they choose another messaging app then it was not necessary to ask them as they would have been able to share both.

Conclusion

I don't think there is an easy way to solve this.

In theory we could modify the React-Native-Share library we are using, and fix that code directly. But that would take a bit of time (1 -2 weeks full time for 1 person). And it would require someone diving into native Android Code.

Another viable option is to ask the user if they are planning on sharing with what app. If they press "no" then we do share normally. If they press "yes" then we let them know they can only share photos OR audio, and have them choose. This would require some design work and it would be not ideal in terms of user flow.