微信开发如何发布分享图片到朋友圈?

微信开发如何发布分享图片到朋友圈?
可以运用如下代码实现

UIImage *imageToShare = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@”%@”, @”http://icons.iconarchive.com/icons/mazenl77/I-like-buttons-3a/512/Cute-Ball-Go-icon.png”]]]];
NSString *message = @”My Application Name”;
NSString *shareBody =@”put Link Here”;

// NSLog(@”%@”,shareBody);
NSArray *postItems = @[message,shareBody,imageToShare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc]
initWithActivityItems:postItems
applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];

发表回复

您的电子邮箱地址不会被公开。