Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions IntentKit.podspec
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
13 changes: 13 additions & 0 deletions IntentKit/Apps/Messanger/Messanger.plist
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Messanger</string>
<key>actions</key>
<dict>
<key>sendMessage:</key>
<string>sms://{{number}}</string>
</dict>
</dict>
</plist>
Binary file addedIntentKit/Apps/Messanger/Messanger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Messanger/Messanger@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Messanger/Messanger@2x~iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Messanger/Messanger@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Messanger/Messanger~iPad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Messanger/Messanger~iPad@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions IntentKit/Apps/Phone/Phone.plist
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Phone</string>
<key>actions</key>
<dict>
<key>sendMessage:</key>
<string>telprompt://{{number}}</string>
</dict>
</dict>
</plist>
Binary file addedIntentKit/Apps/Phone/Phone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Phone/Phone@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Phone/Phone@2x~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Phone/Phone@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Phone/Phone@3x~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedIntentKit/Apps/Phone/Phone~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions IntentKit/Handlers/INKMessageHandler.h
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
//
// INKMessageHandler.h
// Pods
//
// Created by Shane Whitehead on 23/12/2014.
//
//

#import <Foundation/Foundation.h>
#import "INKHandler.h"

@class INKActivityPresenter;

@interface INKMessageHandler : INKHandler

- (INKActivityPresenter *)sendMessage:(NSString *)number;

@end
21 changes: 21 additions & 0 deletions IntentKit/Handlers/INKMessageHandler.m
Original file line numberDiff line numberDiff line change
@@ -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
14 changes: 13 additions & 1 deletion IntentKitDemo/INKViewController.m
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,6 +17,7 @@
#import "INKTwitterHandler.h"
#import "INKFacebookHandler.h"
#import "INKGPlusHandler.h"
#import "INKMessageHandler.h"

#import <UIView+MWLayoutHelpers.h>

Expand DownExpand Up@@ -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"];
}},
]
}
];
};

Expand Down