title: How to share a contact from iOS app to Whatsapp?
body: <p>Sharing .vcf to WhatsApp using UIActivityViewController fails by showing plugin net.whatsapp.WhatsApp.ShareExtension invalidated error</p>
  
  <p><strong>Sharing image or text is working using UIActivityViewController, But sharing .vcf is not working with whatsapp (working fine for mail/message/messenger etc).</strong></p>
  
  <pre><code>NSData *pVcfData     = [CNContactVCardSerialization dataWithContacts:[NSArray arrayWithObject:pContact] error:&amp;pError]; // creating contact data from CNContactVCardSerialization
  
  NSURL *pFileURL      = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:pFileNameWithAllowedCharacters]]; //  wrote the data to file
  
  NSError *pWriteError = nil;
  
  if ([pVcfData writeToURL:pFileURL options:NSDataWritingAtomic error:&amp;pWriteError])
  {
     NSArray *pActivityItems  =  @[pFileURL]; //  passed the file URL as ActivityItem for UIActivityViewController
  
     UIActivityViewController *pActivityVC = [[UIActivityViewController alloc] initWithActivityItems:pActivityItems applicationActivities:nil];
  
     [pActivityVC setValue:pContactName forKey:@"subject"];
  
     [self presentViewController:pActivityVC animated:YES completion:nil];
  }
  </code></pre>
  
  <p><strong>Is there any other method to share contact to whatsapp other than .vcf. Please share any suggestion.</strong></p>