Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
631 views
in Technique[技术] by (71.8m points)

iphone - "This item cannot be shared. Please select a different item." WhatsApp iOS share extension failure message

This bug is fixed by WhatsApp team on 23rd May, 2016 (build no. 2.16.4).

Unable to share NSString object using UIActivityViewController to WhatsApp.

I tried to share using below code. But once contact is selected from the list, it shows an alert displaying "This item cannot be shared. Please select a different item."

CODE

NSString *shareText = @"Temp text to share";
NSArray *itemsToShare = @[shareText];

UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];

I am facing this problem after updating WhatsApp to version 2.16.2

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Received a response from WhatsApp team

- WhatsApp Support -

Hi,

Sorry for the delay! We have received many emails recently, and we do our best to answer them all. Thank you for your patience.

Thank you for informing us about the issue; it will be fixed in a future version of WhatsApp. Unfortunately, we cannot comment on any future timelines, sorry. Thank you for your continued patience and support of WhatsApp.

Cheers, Hans

So, they acknowledge the bug and will fix this in the next release.

Possible Workarounds =>

  • Till then one can use UrlSchemes to share plaintext+url. Follow Spydy's answer.
    OR
  • One can create subclass of UIActivity with activityCategory as UIActivityCategoryShare with whatsapp icon. Then when user selects it, will use urlschemes to share text. For this use JBWhatsAppActivity
    OR
  • Just share NSUrl object for sharing url. Once the fix is done you can revert to sharing plain text and url.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...