Instagram在访问库api之前访问用户验证

时间:2016-05-06 09:51:54

标签: ios instagram

我在Instagram IOS工作,在用户墙上发布图片,然后点https://www.instagram.com/developer/mobile-sharing/iphone-hooks/作为参考。现在想在将帖子发送到Instagram之前验证用户,以检查同一用户是否登录到Instagram。代码就像那样

NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://user?username=%@",@"santanuws1123"]];

    NSLog(@"Opening: %@", instagramURL);

    if ( ![[UIApplication sharedApplication] canOpenURL:instagramURL] ) {
        NSLog(@"Instagram not installed, cannot open instagram url");
    } else {
        [[UIApplication sharedApplication] openURL:instagramURL];
    }

它没有返回或验证。也发帖也不行。

NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@&username=%@", escapedString, escapedCaption,@"santanuws1123"]];

        // Caption is no longer supported by instagram so this url is the correct one:
        // NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@", escapedString]];

        NSLog(@"Opening: %@", instagramURL);

        if ( ![[UIApplication sharedApplication] canOpenURL:instagramURL] ) {
            NSLog(@"Instagram not installed, cannot open instagram url");
        } else {
            [[UIApplication sharedApplication] openURL:instagramURL];
        }

是否可以在用户墙中发帖发送用户名?

0 个答案:

没有答案