receive_sharing_intent icon indicating copy to clipboard operation
receive_sharing_intent copied to clipboard

chat from whatsapp is missing

Open Giacomo1993 opened this issue 3 years ago • 4 comments

Hi, @xal @danReynolds @nrikiji @KasemJaffer,

I want to share with you my problem with this library. My goal is to create a demo app that receives a chat (with images or video and text) from whatsapp. The issue is that I don't receive anything. I'm working and testing with my Android Device, a Samsung A50 (Android 11). If I try to share images, videos from the gallery then this plugin works correctly, also when I try to share text it works correctly, but if I try to share my chat from the export chat of WhatsApp, then the plugin doesn't receive anything.

Could you please help me? Could you please give me some advice?

Thank you in advance, Giacomo.

Giacomo1993 avatar Dec 07 '21 10:12 Giacomo1993

@Giacomo1993

  1. Explore whats app api documentation, find 'export chat' entity type, I think it should be raw text or data like json
  2. Explore plugin java/kotlin code. Add print to log in all methods in chain

I have similar issues with iOS and exploring swift code + logging worked for me to be able work with custom group id

xal avatar Dec 07 '21 10:12 xal

Hi @xal,

Thank you very much!

I'll try it!

Giacomo1993 avatar Dec 07 '21 10:12 Giacomo1993

@Giacomo1993 I was wondering the same thing. Have you found a solution yet?

benstm avatar Jan 10 '22 07:01 benstm

@benhlr @xal @KasemJaffer @danReynolds The problem is that when I export chat from Whatsapp If I want to share Images, text, or both together the Intent is built with IntentType = "text/*" and IntentAction = "SEND_MULTIPLE".
So, I believe that the code of this library isn't compatible with Export Chat from Whatsapp. You can see the images below. I took these snapshots from debugging my app after the chat's export.

Screenshot 2022-02-09 at 11 36 01

Screenshot 2022-02-09 at 11 36 14

This is the HandleIntent function on this library for android side:

private fun handleIntent(intent: Intent, initial: Boolean) { when { (intent.type?.startsWith("text") != true) && (intent.action == Intent.ACTION_SEND || intent.action == Intent.ACTION_SEND_MULTIPLE) -> { // Sharing images or videos

            val value = getMediaUris(intent)
            if (initial) initialMedia = value
            latestMedia = value
            eventSinkMedia?.success(latestMedia?.toString())
        }
        (intent.type == null || intent.type?.startsWith("text") == true)
                && intent.action == Intent.ACTION_SEND -> { // Sharing text
            val value = intent.getStringExtra(Intent.EXTRA_TEXT)
            if (initial) initialText = value
            latestText = value
            eventSinkText?.success(latestText)
        }
        intent.action == Intent.ACTION_VIEW -> { // Opening URL
            val value = intent.dataString
            if (initial) initialText = value
            latestText = value
            eventSinkText?.success(latestText)
        }
    }
}

As you can see, The intent from whatsapp chat doesn't work with this structure.

Could you please make some modifies to this structure in order to make it available for my goal?

Thank you in advance, Giacomo.

Giacomo1993 avatar Feb 09 '22 10:02 Giacomo1993