KasemJaffer / receive_sharing_intent

A Flutter plugin that enables flutter apps to receive sharing photos, text and url from other apps.
Apache License 2.0
334 stars 395 forks source link

[IOS] Duplicate Filenames When Sharing from WhatsApp #322

Open Harshil-d opened 2 months ago

Harshil-d commented 2 months ago

Issue

When sharing multiple files from WhatsApp to our iOS app, some files are received with identical names. This results in fewer files appearing in our app than were originally shared.

Expected Behavior

Each shared file should have a unique name, allowing our app to process and display all files shared from WhatsApp.

Current Behavior

Multiple files shared from WhatsApp sometimes have the same filename, causing our app to overwrite or ignore some files.

IMPORTANT: The problem is most noticeable with photos taken in quick succession, where the timestamp in the filename doesn't include milliseconds.

Example of received files:

AppGroup/F1237D67-4852-45A1-B4FC-67B90A51FBC5/PHOTO-2024-08-20-14-39-52.jpg
AppGroup/F1237D67-4852-45A1-B4FC-67B90A51FBC5/PHOTO-2024-08-20-14-39-53.jpg
AppGroup/F1237D67-4852-45A1-B4FC-67B90A51FBC5/PHOTO-2024-08-20-14-39-53.jpg
AppGroup/F1237D67-4852-45A1-B4FC-67B90A51FBC5/PHOTO-2024-08-20-14-39-54.jpg
AppGroup/F1237D67-4852-45A1-B4FC-67B90A51FBC5/PHOTO-2024-08-20-14-39-54.jpg
AppGroup/F1237D67-4852-45A1-B4FC-67B90A51FBC5/PHOTO-2024-08-20-14-39-55.jpg

In this example, the files with timestamps 14-39-53 and 14-39-54 are duplicated, resulting in only 4 unique filenames instead of the 6 files actually shared.

Steps to Reproduce

  1. Open WhatsApp on iOS
  2. Select multiple photos taken in quick succession (within the same second)
  3. Share these photos to our app
  4. Observe the number of files received in our app
  5. Check the filenames of the received files

Additional Information