diff --git a/IntentKit.podspec b/IntentKit.podspec index a050ad7..e7a505e 100644 --- a/IntentKit.podspec +++ b/IntentKit.podspec @@ -54,4 +54,11 @@ Pod::Spec.new do |s| ss.resource_bundles = { 'IntentKit-INKGPlusHandler' => "IntentKit/Apps/Google+/*.{plist,png}" } ss.requires_arc = true end + + s.subspec 'Message' do |ss| + ss.dependency 'IntentKit/Core' + ss.source_files = 'IntentKit/Handlers/INKMessageHandler.{h,m}' + ss.resource_bundles = { 'IntentKit-INKMessageHandler' => "IntentKit/Apps/{Phone,Messanger}/*.{plist,png}" } + ss.requires_arc = true + end end diff --git a/IntentKit/Apps/Messanger/Messanger.plist b/IntentKit/Apps/Messanger/Messanger.plist new file mode 100644 index 0000000..75fd191 --- /dev/null +++ b/IntentKit/Apps/Messanger/Messanger.plist @@ -0,0 +1,13 @@ + + + + + name + Messanger + actions + + sendMessage: + sms://{{number}} + + + diff --git a/IntentKit/Apps/Messanger/Messanger.png b/IntentKit/Apps/Messanger/Messanger.png new file mode 100644 index 0000000..f321b8d Binary files /dev/null and b/IntentKit/Apps/Messanger/Messanger.png differ diff --git a/IntentKit/Apps/Messanger/Messanger@2x.png b/IntentKit/Apps/Messanger/Messanger@2x.png new file mode 100644 index 0000000..54792d3 Binary files /dev/null and b/IntentKit/Apps/Messanger/Messanger@2x.png differ diff --git a/IntentKit/Apps/Messanger/Messanger@2x~iPad.png b/IntentKit/Apps/Messanger/Messanger@2x~iPad.png new file mode 100644 index 0000000..98986b2 Binary files /dev/null and b/IntentKit/Apps/Messanger/Messanger@2x~iPad.png differ diff --git a/IntentKit/Apps/Messanger/Messanger@3x.png b/IntentKit/Apps/Messanger/Messanger@3x.png new file mode 100644 index 0000000..84c6edb Binary files /dev/null and b/IntentKit/Apps/Messanger/Messanger@3x.png differ diff --git a/IntentKit/Apps/Messanger/Messanger~iPad.png b/IntentKit/Apps/Messanger/Messanger~iPad.png new file mode 100644 index 0000000..d2a7613 Binary files /dev/null and b/IntentKit/Apps/Messanger/Messanger~iPad.png differ diff --git a/IntentKit/Apps/Messanger/Messanger~iPad@3x.png b/IntentKit/Apps/Messanger/Messanger~iPad@3x.png new file mode 100644 index 0000000..5c95924 Binary files /dev/null and b/IntentKit/Apps/Messanger/Messanger~iPad@3x.png differ diff --git a/IntentKit/Apps/Phone/Phone.plist b/IntentKit/Apps/Phone/Phone.plist new file mode 100644 index 0000000..770bdcc --- /dev/null +++ b/IntentKit/Apps/Phone/Phone.plist @@ -0,0 +1,13 @@ + + + + + name + Phone + actions + + sendMessage: + telprompt://{{number}} + + + diff --git a/IntentKit/Apps/Phone/Phone.png b/IntentKit/Apps/Phone/Phone.png new file mode 100644 index 0000000..4c73c01 Binary files /dev/null and b/IntentKit/Apps/Phone/Phone.png differ diff --git a/IntentKit/Apps/Phone/Phone@2x.png b/IntentKit/Apps/Phone/Phone@2x.png new file mode 100644 index 0000000..fd9ee8f Binary files /dev/null and b/IntentKit/Apps/Phone/Phone@2x.png differ diff --git a/IntentKit/Apps/Phone/Phone@2x~ipad.png b/IntentKit/Apps/Phone/Phone@2x~ipad.png new file mode 100644 index 0000000..f97f0b5 Binary files /dev/null and b/IntentKit/Apps/Phone/Phone@2x~ipad.png differ diff --git a/IntentKit/Apps/Phone/Phone@3x.png b/IntentKit/Apps/Phone/Phone@3x.png new file mode 100644 index 0000000..4c3ac70 Binary files /dev/null and b/IntentKit/Apps/Phone/Phone@3x.png differ diff --git a/IntentKit/Apps/Phone/Phone@3x~ipad.png b/IntentKit/Apps/Phone/Phone@3x~ipad.png new file mode 100644 index 0000000..c63b389 Binary files /dev/null and b/IntentKit/Apps/Phone/Phone@3x~ipad.png differ diff --git a/IntentKit/Apps/Phone/Phone~ipad.png b/IntentKit/Apps/Phone/Phone~ipad.png new file mode 100644 index 0000000..a17e161 Binary files /dev/null and b/IntentKit/Apps/Phone/Phone~ipad.png differ diff --git a/IntentKit/Handlers/INKMessageHandler.h b/IntentKit/Handlers/INKMessageHandler.h new file mode 100644 index 0000000..63a8014 --- /dev/null +++ b/IntentKit/Handlers/INKMessageHandler.h @@ -0,0 +1,18 @@ +// +// INKMessageHandler.h +// Pods +// +// Created by Shane Whitehead on 23/12/2014. +// +// + +#import +#import "INKHandler.h" + +@class INKActivityPresenter; + +@interface INKMessageHandler : INKHandler + +- (INKActivityPresenter *)sendMessage:(NSString *)number; + +@end diff --git a/IntentKit/Handlers/INKMessageHandler.m b/IntentKit/Handlers/INKMessageHandler.m new file mode 100644 index 0000000..c913f6e --- /dev/null +++ b/IntentKit/Handlers/INKMessageHandler.m @@ -0,0 +1,21 @@ +// +// INKMessageHandler.m +// Pods +// +// Created by Shane Whitehead on 23/12/2014. +// +// + +#import "INKMessageHandler.h" +#import "INKActivityPresenter.h" + +@implementation INKMessageHandler + +- (INKActivityPresenter *)sendMessage:(NSString *)number { + + NSDictionary *args = @{ @"number" : number }; + return [self performCommand:NSStringFromSelector(_cmd) withArguments:args]; + +} + +@end diff --git a/IntentKitDemo/INKViewController.m b/IntentKitDemo/INKViewController.m index 75dd33f..03c9ec8 100644 --- a/IntentKitDemo/INKViewController.m +++ b/IntentKitDemo/INKViewController.m @@ -17,6 +17,7 @@ #import "INKTwitterHandler.h" #import "INKFacebookHandler.h" #import "INKGPlusHandler.h" +#import "INKMessageHandler.h" #import @@ -210,7 +211,18 @@ - (NSArray *)content { return [handler showGPlusProfileWithName:@"ArvidGerstmann"]; }}, ] - } + }, + @{@"name": @"INKMessageHandler", + @"items": @[ + @{@"description": @"Send message to or phone number", + @"action": (UIActivityViewController *)^{ + INKMessageHandler *handler = [[INKMessageHandler alloc] init]; + handler.alwaysShowActivityView = self.activitySwitch.on; + handler.useSystemDefault = self.useSystemDefaultSwitch.on; + return [handler sendMessage:@"1234567890"]; + }}, + ] + } ]; };