mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-21 05:45:13 +00:00
97 lines
1.9 KiB
Objective-C
Executable file
97 lines
1.9 KiB
Objective-C
Executable file
//
|
|
// OSKSafariActivity.m
|
|
// Overshare
|
|
//
|
|
// Created by Jared Sinclair on 10/15/13.
|
|
// Copyright (c) 2013 Overshare Kit. All rights reserved.
|
|
//
|
|
|
|
#import "OSKSafariActivity.h"
|
|
|
|
#import "OSKShareableContentItem.h"
|
|
|
|
@implementation OSKSafariActivity
|
|
|
|
- (instancetype)initWithContentItem:(OSKShareableContentItem *)item {
|
|
self = [super initWithContentItem:item];
|
|
if (self) {
|
|
//
|
|
}
|
|
return self;
|
|
}
|
|
|
|
#pragma mark - OSKURLSchemeActivity
|
|
|
|
- (BOOL)targetApplicationSupportsXCallbackURL {
|
|
return NO;
|
|
}
|
|
|
|
#pragma mark - Methods for OSKActivity Subclasses
|
|
|
|
+ (NSString *)supportedContentItemType {
|
|
return OSKShareableContentItemType_WebBrowser;
|
|
}
|
|
|
|
+ (BOOL)isAvailable {
|
|
return YES;
|
|
}
|
|
|
|
+ (NSString *)activityType {
|
|
return OSKActivityType_iOS_Safari;
|
|
}
|
|
|
|
+ (NSString *)activityName {
|
|
return @"Safari";
|
|
}
|
|
|
|
+ (UIImage *)iconForIdiom:(UIUserInterfaceIdiom)idiom {
|
|
UIImage *image = nil;
|
|
if (idiom == UIUserInterfaceIdiomPhone) {
|
|
image = [UIImage imageNamed:@"osk-safariIcon-60.png"];
|
|
} else {
|
|
image = [UIImage imageNamed:@"osk-safariIcon-76.png"];
|
|
}
|
|
return image;
|
|
}
|
|
|
|
+ (OSKAuthenticationMethod)authenticationMethod {
|
|
return OSKAuthenticationMethod_None;
|
|
}
|
|
|
|
+ (BOOL)requiresApplicationCredential {
|
|
return NO;
|
|
}
|
|
|
|
+ (OSKPublishingMethod)publishingMethod {
|
|
return OSKPublishingMethod_URLScheme;
|
|
}
|
|
|
|
- (BOOL)isReadyToPerform {
|
|
return ([[UIApplication sharedApplication] canOpenURL:[self browserItem].url]);
|
|
}
|
|
|
|
- (void)performActivity:(OSKActivityCompletionHandler)completion {
|
|
[[UIApplication sharedApplication] openURL:[self browserItem].url];
|
|
if (completion) {
|
|
completion(self, YES, nil);
|
|
}
|
|
}
|
|
|
|
+ (BOOL)canPerformViaOperation {
|
|
return NO;
|
|
}
|
|
|
|
- (OSKActivityOperation *)operationForActivityWithCompletion:(OSKActivityCompletionHandler)completion {
|
|
return nil;
|
|
}
|
|
|
|
- (OSKWebBrowserContentItem *)browserItem {
|
|
return (OSKWebBrowserContentItem *)self.contentItem;
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|