-1

I have used UIActivityViewController for sharing my message in Facebook, Twitter, Viber etc....It seems the message is send twice in Viber but for others are ok. Can u please help me?? I have used the code given below...

-(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];

}
  • 1
    It's probably a bug with the Viber App Extension. I doubt there is anything you can do to fix this. (Maybe consider submitting a bug report to Viber). –  Jul 10 '15 at 10:21
  • 1
    @Dan, u r right. Thanks –  Jul 11 '15 at 18:01

1 Answers1

1

After many searching and doing in several way I see that it only happens when I share an array, it can not handle the shared object of the array properly, maybe its a bug of viber. When I post only one string or url it can send properly. I have tested using 2,3,4 items arrry and only one single string/url etc.