我已经使用 UIActivityViewController 在 Facebook、Twitter、Viber 等中分享我的消息。似乎消息在 Viber 中发送了两次,但对其他人来说还可以。你能帮帮我吗?我已经使用了下面给出的代码......
-(void)shareContent {
NSString * message;
NSArray * itemsArray = [NSArray new] ;
if ([shareFlag isEqualToString:@"Friend"]) {
message = @"Hi, I am using Amar Sticker, an amazing app to download & share cool Bangla Stickers. Click here and get it for FREE: http://goo.gl/qK7HRw";
NSURL *appLink = [NSURL URLWithString:@"http://goo.gl/qK7HRw"];
itemsArray = @[message, appLink];
shareFlag = @"";
}
UIActivityViewController * avc = [[UIActivityViewController alloc] initWithActivityItems:itemsArray applicationActivities:nil];
[avc setExcludedActivityTypes:@[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard,UIActivityTypeSaveToCameraRoll]];
[avc setCompletionHandler:^(NSString *activityType, BOOL completed) {
}];
[self presentViewController:avc animated:YES completion:nil];
}