내 itunes 제휴사 링크를 추적하기 위해 bit.ly를 사용하고 싶습니다. http://target.georiot.com에서 제휴사 링크를받습니다. 직접 연결을 반대 할 때 작동합니다 (iTunes로 이동). 하지만 조금씩 제휴사 링크를 단축하면 같은 페이지로 연결되지 않습니다. "....///phobos.apple.com/WebObjects HTTP"모든IOS 제휴사 링크가 bit.ly와 작동하지 않음
NSString *longURL = link;
NSString *bitlyRequestURLString = [NSString stringWithFormat:@"http://api.bit.ly/shorten?version=2.0.1&format=xml&login=%@&apiKey=%@&longUrl=%@",
@"myappname",
@"myappidentifier",
longURL];
NSURL *bitlyURL = [NSURL URLWithString:bitlyRequestURLString];
// get the short URL from bit.ly
NSError *error;
NSString *response = [NSString stringWithContentsOfURL:bitlyURL encoding:NSUTF8StringEncoding error:&error];
NSString *shortURL = @"";
NSArray *responseParts = [response componentsSeparatedByString:@"<shortUrl>"];
if ([responseParts count] > 1) {
NSString *responsePart = [responseParts objectAtIndex:1];
responseParts = [responsePart componentsSeparatedByString:@"</shortUrl>"];
if ([responseParts count] > 0) {
shortURL = [responseParts objectAtIndex:0];
}
}
마지막 리디렉션 링크가 같이가 someting 간다 : 여기
은 Lite 버전 URL을 가져 오는 코드입니다 아이디어? 당신은 아마 URL 필요 감사
마지막 리디렉션 링크가 내게 적합합니다. 어떻게 잘못 되었습니까? –
Itunes로 보내면 원하는 페이지로 이동하지 않습니다. – user1078065
원하는 페이지가 무엇입니까? apple.com에없는 무언가? –