# Opening Instagram app on button click

**URL:** <https://forums.kodeco.com/t/opening-instagram-app-on-button-click/18189>\
**Category:** iOS\
**Created:** [August 6, 2016, 11:12am UTC](https://forums.kodeco.com/t/opening-instagram-app-on-button-click/18189 "2016-08-06T11:12:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramaaaaaa](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/ramaaaaaa/32/38500_2.png) [@ramaaaaaa](https://forums.kodeco.com/u/ramaaaaaa)\
**Post date:** [August 6, 2016, 11:12am UTC](https://forums.kodeco.com/t/opening-instagram-app-on-button-click/18189/1 "2016-08-06T11:12:15Z")

</div>

Hello Guys am trying to open instagram app on button click but not able to open  
here s what i did

```nohighlight
NSString *instagramURL = @"instagram://app";
NSURL *ourURL = [NSURL URLWithString:instagramURL];
if ([[UIApplication sharedApplication]canOpenURL:ourURL])
{   
    [[UIApplication sharedApplication]openURL:ourURL];        
} else {
    //The App is not installed. It must be installed from iTunes code.
    NSString *iTunesLink = @"//Your itunes Url";
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];
        
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"URL error"
                                                   message:[NSString stringWithFormat:
                                                       @"No custom URL defined for %@", ourURL]
                                                  delegate:self cancelButtonTitle:@"Ok"
                                         otherButtonTitles:nil];
    [alert show];
}

```

and i set urlschema in plist as instagram

where am doing wrong and i did write any line in app delegate

```nohighlight
-(BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options{
    return YES;
}

```

and i registered app in instagram also am new to ios any help would be appriciated
