我的应用有一个邀请好友的页面,需要调用分享,直接看代码

//分享的标题
NSString *textToShare = @“邀请好友”;
UICollectionViewCell *shareCell = [self.cycleScrollView3.collectionView cellForItemAtIndexPath:indexPath];
UIImage *shareImg = [self convertViewToImage:shareCell.contentView];
if (shareImg == nil) {
[self showWithLabel:@“分享失败”];
return;
}
NSData * shareData = UIImageJPEGRepresentation(shareImg, 0.5);
NSArray *activityItems = @[textToShare,shareData];
UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
// 分享之后的回调
activityVC.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) {
if (completed) {
NSLog(@“completed”);
//分享 成功
} else {
NSLog(@“cancled = %@”,activityError);
//分享 取消
}
};

然后点击微信去分享,在非刘海屏手机大概10%以下概率回遇到下面这种情况,在刘海屏大概30%到概率,求大佬解惑
iOS调用系统原生分享报错 提示 不支持的分享类型,无法分享到微信

相关文章:

  • 2022-02-10
  • 2021-10-03
  • 2021-12-29
  • 2022-01-07
  • 2022-12-23
  • 2021-07-15
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2021-09-09
  • 2021-11-02
相关资源
相似解决方案