aboutsummaryrefslogtreecommitdiffstats
path: root/CopyMailto/DefaultURLHandler.m
blob: a8d124fb85f89febb1b4819d7bfb80684c191f99 (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
25
26
27
28
//
//  DefaultURLHandler.m
//  CopyMailto
//
//  Created by tw on 9/5/18.
//  Copyright © 2018 tw. All rights reserved.
//

#import "DefaultURLHandler.h"

@implementation DefaultURLHandler

//LSSetDefaultHandlerForURLScheme();
+ (void)saveDefaultURLHandler {
    CFStringRef mailto = CFStringCreateWithCString(
        kCFAllocatorDefault,
        "mailto",
        kCFStringEncodingUTF8
    );

    CFStringRef bundle_identifier = LSCopyDefaultHandlerForURLScheme(mailto);
    NSLog(@"%@", bundle_identifier);

    CFRelease(mailto);
    CFRelease(bundle_identifier);
}

@end