0

我在我的 iOS 应用程序中使用 slcomposeviewcontroller。当用户使用 slcomposeviewcontroller 将我的应用程序中的图像共享到 facebook 时,我想获取他创建的照片的 id。我看到有一个名为 completionHandler 的处理程序,但它不返回任何 id。

我有什么解决方法来获取共享图像 ID?

4

1 回答 1

0

The project I'm working right now requires an image id like yours. I tested it and it's working, here you are..

- (void) collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{


    ALAsset *asset = self.assets[indexPath.row];//Which image are you pressed in a imagepickerview

    ALAssetRepresentation *defaultRep = [asset defaultRepresentation];
    NSString *tmp1=[[defaultRep url] absoluteString];
    NSArray *imageID ;

    imageID = [tmp1 componentsSeparatedByString: @"id="];
    imageID=[imageID[1] componentsSeparatedByString: @"&ext"];
    NSLog(@"image id is : %@",imageID[0]);
}
于 2014-01-07T15:07:53.933 回答