I can easy implement log in with facebook on iPhone. But I heared, that there was no official API for pinterest.
So I wonder if there is a way to implement login wi
Hi there is no official api for Pinterest, But
Here is a link already answered
or try like this, create button with the following target
[pintrestBtn addTarget:self action:@selector(pintrestButtonSelcted) forControlEvents:UIControlEventTouchUpInside]
and push when the htmlstring
comes as perfect url push it to another viewcontroller which has webview and load this htmlstring
in that webview
- (void) pintrestButtonSelcted {
NSString *htmlString = [self generatePinterestHTMLForSKU:nil];
NSLog(@"Generated HTML String:%@", htmlString);
WebViewController *webViewController = [[WebViewController alloc] init];
webViewController.htmlString = htmlString;
webViewController.view.frame = CGRectMake(0, 0, 300, 300);
[self presentModalViewController:webViewController animated:YES];
}
- (NSString*) generatePinterestHTMLForSKU:(NSString*)sku {
NSString *description = @"Post your description here";
// Generate urls for button and image
NSString *sUrl = [NSString stringWithFormat:@"http://reedperry.com/2011/04/27/apple-logo/"];
NSLog(@"URL:%@", sUrl);
NSString *protectedUrl = ( NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,( CFStringRef)sUrl, NULL, (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
NSLog(@"Protected URL:%@", protectedUrl);
NSString *imageUrl = [NSString stringWithFormat:@"\"%@\"", sUrl];
NSString *buttonUrl = [NSString stringWithFormat:@"\"http://pinterest.com/pin/create/button/?url=http://itunes.apple.com/us/app/pinterest/id429047995?mt=8&media=http://reedperry.com/2011/04/27/apple-logo/%@&description=Welcome you all%@\"", protectedUrl, description];
NSMutableString *htmlString = [[NSMutableString alloc] initWithCapacity:1000];
[htmlString appendFormat:@" "];
[htmlString appendFormat:@"", buttonUrl];
[htmlString appendFormat:@"", imageUrl];
[htmlString appendFormat:@""];
[htmlString appendFormat:@" "];
return htmlString;
}