aboutsummaryrefslogtreecommitdiffstats
path: root/Copy Mailto/DefaultURLHandler.m
blob: 595a244f33788fdc65becdd6ea6907318c664dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//
//  DefaultURLHandler.m
//  Copy Mailto
//
//  Created by tw on 9/5/18.
//  Copyright © 2018 Teddy Wing
//

#import "DefaultURLHandler.h"

@implementation DefaultURLHandler

+ (OSStatus)setDefaultURLHandler {
    CFStringRef scheme = (CFStringRef)@"mailto";
    CFStringRef bundle_identifier = (__bridge CFStringRef)[[NSBundle mainBundle] bundleIdentifier];

    OSStatus status = LSSetDefaultHandlerForURLScheme(scheme, bundle_identifier);

    CFRelease(scheme);

    return status;
}

@end