Instagram iPhone Hook Description

169 Views Asked by At

Is there a opportunity to add a description to a new Instagram post created via iPhone Hook?

        NSString *moviePath = outputPath;
        NSString *caption = @"description";
        NSURL *movieURL = [NSURL fileURLWithPath:moviePath isDirectory:NO];
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeVideoAtPathToSavedPhotosAlbum:movieURL
                                    completionBlock:^(NSURL *assetURL, NSError *error)
        {
            NSURL *instagramURL = [NSURL URLWithString:
                                   [NSString stringWithFormat:@"instagram://library?AssetPath=%@&annotation=%@",
                                    [[assetURL absoluteString] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]],
                                    [caption stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet alphanumericCharacterSet]]]
                                   ];
            if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) {
                [[UIApplication sharedApplication] openURL:instagramURL];
            }
            else {
                NSLog(@"Can't open Instagram");
            }
        }];

I tried thus but it doesn't show anything in the description text field. Can you help me?

0

There are 0 best solutions below