“This item cannot be shared. Please select a different item.” WhatsApp iOS share extension failure message

前端 未结 7 607
长情又很酷
长情又很酷 2020-12-08 02:15

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

Unable to share NSString object using UIActivityViewControll

7条回答
  •  佛祖请我去吃肉
    2020-12-08 03:03

    I'm not sure about your question... Do you want just send text by whatsapp? If yes, you don't need use UIActivityViewController. Just use urlschemes.

    Something like that:

    NSString *string = @"whatsapp://send?text=";
    NSURL *url = [NSURL URLWithString:[string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    [[UIApplication sharedApplication] openURL: ];
    

    You also can check if the user have whatsapp installed

    if ([[UIApplication sharedApplication] canOpenURL: url]) {
       // wahtsapp installed
    } else {
       // whatsapp not installed
    }
    

    Look this question: Share image/text through WhatsApp in an iOS app

提交回复
热议问题