Latest | 1.0 |
---|---|
Homepage | https://github.com/jberlana/JBWhatsAppActivity |
License | MIT |
Platforms | ios , requires ARC |
Authors |
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
Credit
Javier Berlana, Sweetbits
Latest podspec
{ "name": "JBWhatsAppActivity", "version": "1.0", "summary": "JBWhatsAppActivity is a UIActivity subclass that provides an u201cShare in WhatsApp" action to a UIActivityViewController.", "license": { "type": "MIT", "file": "License.md" }, "homepage": "https://github.com/jberlana/JBWhatsAppActivity", "authors": { "Javier Berlana": "[email protected]" }, "source": { "git": "https://github.com/jberlana/JBWhatsAppActivity.git", "tag": "1.0" }, "platforms": { "ios": null }, "source_files": "JBWhatsAppActivity/*.{h,m}", "resources": "JBWhatsAppActivity/[email protected]", "requires_arc": true }
Sun, 28 Feb 2016 20:16:03 +0000