ShareKit跳过分享表iOS 8 for Instagram

时间:2015-04-27 21:57:21

标签: ios objective-c sharekit

我正在使用ShareKit将我的应用程序中的图像分享到Instagram

UIImage *image = viewTheme.image;
SHKItem *item = [SHKItem image:image title:@"Check this out! "];
[SHK setRootViewController:self];
[SHKInstagram shareItem:item];

它会显示一个包含Facebook按钮和Instagram中的打开按钮的共享表。所以我想知道是否有办法直接调用Instagram中的open操作,或者,如果不可能,则删除该Facebook按钮(如果可能的话也会删除更多按钮)。

enter image description here更新

我在app delegate中有这个

DefaultSHKConfigurator *configurator = [[MyShareConfigurator alloc] init];
    [SHKConfiguration sharedInstanceWithConfigurator:configurator];

我的配置器子类就是这个

- (NSString*)appName {
    return [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"];

}

- (NSString*)appURL {
    return @"https://github.com/ShareKit/ShareKit/";
}

# pragma mark - API Keys



- (NSString*)facebookAppId {
    return @"466611176835259";
}

- (NSString*)facebookLocalAppId {
    return @""; //Si no se usa se deja vacion
}

- (NSNumber*)forcePreIOS6FacebookPosting {
    return [NSNumber numberWithBool:false];
}


- (NSNumber*)forcePreIOS5TwitterAccess {
    return [NSNumber numberWithBool:false];
}

- (NSString*)twitterConsumerKey {
    return @"ZGcj7yhbGSDUlXHHlLBwkC1Dc";
}

- (NSString*)twitterSecret {
    return @"naFO0wcOvGtoGJS6jPNFRREKYhfLTiXa9UtD1mRezzFP0q3Xcv";
}

- (NSString*)twitterCallbackUrl {
    return @"http://www.twitter.com";
}

- (NSNumber*)twitterUseXAuth {
    return [NSNumber numberWithInt:0];
}

- (NSString*)twitterUsername {
    return @"";
}


// Instagram crops images by default
- (NSNumber*)instagramLetterBoxImages {
    return [NSNumber numberWithBool:YES];
}

- (UIColor *)instagramLetterBoxColor
{
    return [UIColor whiteColor];
}

- (NSNumber *)instagramOnly {
    return [NSNumber YES];
}

#pragma mark - UI Configuration : Basic

- (NSNumber *)useAppleShareUI {
    return @YES;
}

- (UIColor*)barTintForView:(UIViewController*)vc {

    if ([NSStringFromClass([vc class]) isEqualToString:@"SHKTwitter"])
        return [UIColor colorWithRed:0 green:151.0f/255 blue:222.0f/255 alpha:1];

    if ([NSStringFromClass([vc class]) isEqualToString:@"SHKFacebook"])
        return [UIColor colorWithRed:59.0f/255 green:89.0f/255 blue:152.0f/255 alpha:1];

    return nil;
}

- (NSNumber*)showActionSheetMoreButton {
    return [NSNumber numberWithBool:false];// Setting this to true will show More... button in SHKActionSheet, setting to false will leave the button out.
}

我还创建了一个我正在尝试做的快速示例,您可以在此处下载:https://www.dropbox.com/s/n09gnq4ul3lcdtk/sharePodTest.zip?dl=0

1 个答案:

答案 0 :(得分:1)

在配置器子类

中实现此方法
///only show instagram in the application list (instead of Instagram plus any other public/jpeg-conforming apps) 
- (NSNumber *)instagramOnly {
    return [NSNumber numberWithBool:YES];
}
编辑:我做了一些调查。 ShareKit按预期工作,并根据Instagram dev guidelines。如果将instagramOnly设置为NO,则会看到更多选项。因此,似乎Facebook应用程序也能够分享@" com.instagram.exclusivegram" UTI,对他们来说并不是很好。但不幸的是,除了在Facebook上提交错误报告外,我们无能为力。