手順は以下
TargetのinfoからURL Typesを選択して、「+」をクリック
そうすると入力欄が表示されるので、「identifier」と「URL Schemes」を入力
identifier は アプリのid
URL Schemes は開きたいurlにします。(他のアプリをかぶらない様に注意)
NSURL *appURL = [NSURL URLWithString:@"aaaaaa:"]; // aaaaaaにスキーマを設定
NSURL *strURL = [NSURL URLWithString:@"https://itunes.apple.com/us/app/aaaaaa/id000000000?l=ja&ls=1&mt=8"]; // AppStoreのURLを設定
if([[UIApplication sharedApplication] canOpenURL:appURL] == YES)
{
[[UIApplication sharedApplication] openURL:appURL];
}
else
{
[[UIApplication sharedApplication] openURL:strURL];
}
#pragma mark -
#pragma mark UITableViewDelegate method
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
if(section == 0)
{
[view setTintColor:[UIColor orangeColor]];
}
else if(section == 1)
{
[view setTintColor:[UIColor greenColor]];
}
}
Advertising Identifier Does this app use the Advertising Identifier (IDFA)? The Advertising Identifier (IDFA) is a unique ID for each iOS device and is the only way to offer targeted ads. Users can choose to limit ad targeting on their iOS device.