Sign in with Pinterest

I can easily implement login using facebook on iPhone. But I heard that there was no official API for pinterest.

So, I wonder if there is a way to implement a Pinterest login. Therefore, my application can identify the user after logging in using pinterest.

+4
source share
3 answers

Without the official Pinterest Pinterest public API , everything you write to be some sort of workaround will likely break very easily. It's best to register with Pintrist directly and hopefully they populate you with access to the beta SDK or API as soon as they come up.

Nevertheless , there is apparently potentially material available , but not sure what the current status is.

+4
source

Pintrest uses oAuth2, you should use it like all other providers, i.e. GET request to a specific URL to receive a token, step-by-step instructions can be found here http://tijn.bo.lt/pinterest-api

OAuth2 is the official api, the problem comes down to finding the endpoint and GET syntax. It should be noted that the returned object may contain different values ​​for providers, for example, I needed a Twitter and FB solution, but Twitter does not give you the user's email, so you had to ask it separately (to uniquely identify the same account through suppliers) For ruby ​​there is an omniauth stone, which allows you to use several providers (strategies) with ease. Do not complicate the deployment of your own solution or find a library for iOS

+1
source

Hi, there is no official api for Pinterest, but
Here is already a reciprocal link

or try to do this, create a button with the following purpose
[pintrestBtn addTarget:self action:@selector(pintrestButtonSelcted) forControlEvents:UIControlEventTouchUpInside]

and click when htmlstring becomes the perfect url, click it in another view manager which has a htmlstring and loads that htmlstring into this htmlstring

 - (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:@"<html> <body>"]; [htmlString appendFormat:@"<p align=\"center\"><a href=%@ class=\"pin-it-button\" count-layout=\"horizontal\"><img border=\"0\" src=\"http://assets.pinterest.com/images/PinExt.png\" title=\"Pin It\" /></a></p>", buttonUrl]; [htmlString appendFormat:@"<p align=\"center\"><img width=\"400px\" height = \"400px\" src=%@></img></p>", imageUrl]; [htmlString appendFormat:@"<script type=\"text/javascript\" src=\"//assets.pinterest.com/js/pinit.js\"></script>"]; [htmlString appendFormat:@"</body> </html>"]; return htmlString; 

}

0
source

All Articles