Xcode7

iOS9 / Xcode7์—์„œ Facebook๋“ฑ ๋‹ค๋ฅธ app์˜ URL Scheme ํ˜ธ์ถœ ์‹คํŒจ

iOS์˜ social / account framework์„ ์ด์šฉํ•œ ํŽ˜์ด์Šค๋ถ ๋กœ๊ทธ์ธ ๊ตฌํ˜„์‹œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•˜์˜€๋‹ค.
fb://๋กœ ์‹œ์ž‘ํ•˜๋Š” url์— ์ ‘์† ๊ฐ€๋Šฅํ•œ์ง€ ์—ฌ๋ถ€, ์ฆ‰ Facebook app์ด ์„ค์น˜๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋ ค๊ณ  ๋‹ค์Œ์˜ ์ฝ”๋“œ๋ฅผ ํ˜ธ์ถœํ•˜์˜€๋‹ค.

-(BOOL) functionName {
    if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://]]) {
        NSString *urlString = request.URL.absoluteString;
        
        if ([@https://m.facebook.com/plugins/login_success.php" isEqualToString:urlString]) {
            [self accountStore];
            
            return NO;
        }
        
        return YES:
    }
    
    return YES;
}

ํ•˜์ง€๋งŒ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์„ธ์ง€๋ฅผ ์ค„๊ธฐ์ฐจ๊ฒŒ ๋ฑ‰์–ด๋ƒˆ๋‹ค.

2015-08-24 21:57:23.219 meerkat[277:20308] -canOpenURL: failed for URL: “fb://” โ€“ error: “This app is not allowed to query for scheme fb”