In my app i want to create a share button with WhatsApp,Facebook,Twitter,Mail like this.
Here is my code
-(IBAction)share:(id)sender
{
NSString *shareText = @"Hi This is a Reward Game App";
NSArray *itemsToShare = @[shareText];
UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:itemsToShare applicationActivities:nil];
activityVC.excludedActivityTypes = @[UIActivityTypePostToWeibo,UIActivityTypePostToTwitter,UIActivityTypePostToFacebook,UIActivityTypeMail,UIActivityTypeMessage,UIActivityTypeAssignToContact,UIActivityTypePostToTencentWeibo];
[self presentViewController:activityVC animated:YES completion:nil];
}
I'm writing this code my simulator display like this,
It shows only mail and facebook icons, i want whatsup icon message like this nore.
-(IBAction)shareAction:(id)sender
{
NSArray* sharedObjects=[NSArray arrayWithObjects:@"sharecontent", nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:sharedObjects applicationActivities:nil];
activityViewController.popoverPresentationController.sourceView = self.view;
[self presentViewController:activityViewController animated:YES completion:nil];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With