I'm trying to integrate pin it button to my native ios App. Below is mycode for selecting image and storing ImageURL.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
chosenImage = info[UIImagePickerControllerEditedImage];
self.imageView.image = chosenImage;
NSURL* localUrl = (NSURL *)[info valueForKey:UIImagePickerControllerReferenceURL];
imgURL = [NSString stringWithFormat:@"%@",localUrl];
[picker dismissViewControllerAnimated:YES completion:NULL];
}
and for pinning Image
_pinterest = [[Pinterest alloc] initWithClientId:@"myID"];
[_pinterest createPinWithImageURL:[NSURL URLWithString:imgURL]
sourceURL:[NSURL URLWithString:@"http://www.social-pony.com/"]
description:@"Pinning from MyDemoApp"];
Where for imgURL is a String in which I'm storing ImagURL, This is what I get in imgURL when I printed the log "assets-library://asset/asset.PNG?id=CDA5C2B3-3CC0-4FF9-89E5-1F0F5205B7D8&ext=PNG" I know there is something wrong with the URL But This is the only way I know to get Image URL.
Thanks