Closed venky9885 closed 10 months ago
I'm having this issue with the share files
W/Bundle (16385): Key android.intent.extra.TEXT expected ArrayList
I'm having the same problem too
Exception has occurred. PlatformException (PlatformException(No Activity found to handle Intent { act=android.intent.action.SEND typ=application/pdf flg=0x10000001 pkg=com.whatsapp clip={application/pdf {T(19)}} (has extras) }, null, null, null))
Hello @bayramaliunuvar , @debmezz , @venky9885
Please upgrade whatsapp_share
package to 2.0.2
and let me know if it fixes the issue.
dependencies:
whatsapp_share: ^2.0.2
The problem still persists, my friend.
I used the screenshot sharing code in the sample codes and it gives the following error.
Hey @bayramaliunuvar Can you try this function?
Future<void> shareScreenShot() async {
Directory? directory;
if (Platform.isAndroid) {
directory = await getExternalStorageDirectory();
} else {
return;
}
final String? localPath =
await _controller.captureAndSave(directory!.path);
await Future.delayed(const Duration(seconds: 1));
if (localPath == null) {
log("localPath is null");
return;
}
await WhatsappShare.shareFile(
phone: '911234567890',
filePath: [localPath!],
);
}
I found the problem, Whatsapp is not installed on my phone. Whatsapp business installed. For this reason, I was able to run it with the following code. Mandatory WhatsApp package needs to be specified
await WhatsappShare.shareFile( phone: FastMethods().whatsAopIcinTelDuzelt( _telNoController.text), filePath: [pdfPath], package: Package.businessWhatsapp);
If WhatsApp package not specified, default WhatsApp is used.
For more reliability, consider checking is WhatsApp or Business WhatsApp is installed in user's device or not.
Future<void> isInstalled() async {
final val = await WhatsappShare.isInstalled(
package: Package.businessWhatsapp
);
print('Whatsapp Business is installed: $val');
}
Closing this issue! Feel free to comment otherwise.
Many users reported from 5 days that file is not sharing in android 11 please solve it ASAp