androidkotlinandroid-intentwhatsappandroid-sharing

Sharing Content to WhatsApp Fails When AppLock is Enabled


I'm working on an Android app that includes a feature to share content to WhatsApp. The sharing functionality works perfectly under normal conditions. However, when the AppLock for WhatsApp is enabled, the feature breaks. The content that normally gets shared without issues is not being shared when the AppLock is active.

When AppLock is enabled, WhatsApp requires the user to unlock the app first before it can handle the incoming intent. This interruption seems to prevent the content from being shared.

I tried looking through articles but wasn't able to find any concrete solution.

  1. Why does sharing to WhatsApp fail when AppLock is enabled?
  2. How can I handle the AppLock interruption gracefully and ensure that the content is shared after the user unlocks WhatsApp?
  3. Are there any workarounds or best practices for dealing with AppLock when sharing content via intents?

Any insights or solutions would be greatly appreciated!


Solution

  • The issue I found was that the content doesn't share after app lock if it contains images/videos. This goes across apps. I tested it with a couple of other apps like Google Keep. If the app lock is enabled then the content containing images won't be passed via intent. However, the text-only content sharing works well. Hopefully, if there comes an intent flag in future that can help us determine about the status of unlock of this app lock, then I think we might be able to share images.