0

Like snapshot shown, how to move wechat to bottom, like Line does?

I went through LineActvity.m that is from here: https://github.com/OopsMouse/LINEActivity

but nothing found about order or position....

How to make it happen?

#import "LINEActivity.h"

@implementation LINEActivity

- (NSString *)activityType {
    return @"jp.naver.LINEActivity";
}

- (UIImage *)activityImage
{
    return [UIImage imageNamed:@"LINEActivityIcon.png"];
}

- (NSString *)activityTitle
{
    return @"LINE";
}

- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems
{
    for (id activityItem in activityItems) {
        if ([activityItem isKindOfClass:[NSString class]] || [activityItem isKindOfClass:[UIImage class]]) {
        return YES;
        }
    }
    return NO;
}

- (void)prepareWithActivityItems:(NSArray *)activityItems {
    for (id activityItem in activityItems) {
        if ([self openLINEWithItem:activityItem])
            break;
    }
}

- (BOOL)isUsableLINE
{
    return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"line://"]];
}

- (void)openLINEOnITunes
{
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/jp/app/line/id443904275?ls=1&mt=8"]];
}

- (BOOL)openLINEWithItem:(id)item
{
    if (![self isUsableLINE]) {
        [self openLINEOnITunes];
        return NO;
    }

    NSString *LINEURLString = nil;
    if ([item isKindOfClass:[NSString class]]) {
        NSString *urlEncodeString = (NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes( NULL, (CFStringRef)item, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]", kCFStringEncodingUTF8 ));
        LINEURLString = [NSString stringWithFormat:@"line://msg/text/%@", urlEncodeString];
    } else if ([item isKindOfClass:[UIImage class]]) {
        UIPasteboard *pasteboard = [UIPasteboard pasteboardWithUniqueName];
        [pasteboard setData:UIImagePNGRepresentation(item) forPasteboardType:@"public.png"];
        LINEURLString = [NSString stringWithFormat:@"line://msg/image/%@", pasteboard.name];
    } else {
        return NO;
    }

    NSURL *LINEURL = [NSURL URLWithString:LINEURLString];
    [[UIApplication sharedApplication] openURL:LINEURL];
    return YES;
    }

enter image description here

Bryan Chen
  • 45,816
  • 18
  • 112
  • 143
S1U
  • 825
  • 2
  • 14
  • 26

1 Answers1

1

This is simple, you just need to override one method in your LineActivity.m class

+ (UIActivityCategory)activityCategory
{
   return UIActivityCategoryAction;
}

There are basically two category UIActivityCategoryShare & UIActivityCategoryAction which you can use according to your need for more detail please refer apple docs for UIActivity Class Reference.

Rajat
  • 1,043
  • 12
  • 23