JBWhatsAppActivity 1.0

JBWhatsAppActivity 1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total24,681
Week0
Month0

Installs

Apps444
Test Targets10
Watch Apps3
powered by Segment

GitHub

Stars103
Watchers7
Forks19
Issues4
Contributors1
Pull Requests0

Code

Files2
LOCLines of Code 81


  • By
  • Javier Berlana

JBWhatsAppActivity is a UIActivity subclass that provides an “Share in WhatsApp" action to a UIActivityViewController.

Installation

  • Drag JBWhatsAppActivity.h .m and whatsapp.png files into your project.

Features

  • If a message and an ABID is provided, JBWhatsAppActivity sends a direct message to a contact.
  • If just a message is defined, JBWhatsAppActivity opens WhatsApp contact picker to select a receiver.
  • If no message and ABID is provided, then JBWhatsAppActivity just open WhatsApp.

Usage

(see example Xcode project in /DemoProject)

Create a WhatsAppMessage Object

WhatsAppMessage *whatsappMsg = [[WhatsAppMessage alloc] initWithMessage:_messageTextField.text forABID:_abidTextField.text];
activityItems = @[_messageTextField.text, whatsappMsg];

Add it to your UIActivityViewController:

NSArray *applicationActivities = @[[[JBWhatsAppActivity alloc] init]];
NSArray *activityItems = @[_messageTextField.text, whatsappMsg];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:applicationActivities];
[self presentViewController:activityViewController animated:YES completion:^{}];

Demo

image

Credit

Javier Berlana, Sweetbits