Share Pin using Pinterest SDK
try the following code....its i am using in my project...
_pinterest = [[Pinterest alloc] initWithClientId:@"XXXXX" ];
NSString *imageKey =[NSString stringWithFormat:@"%@",Url];
NSString *captionKey = TempCaption;
NSLog(@"pinterest :%@ -- %@",imageKey,captionKey);
NSURL *imageUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@",imageKey]];
NSURL *sourceUrl = [NSURL URLWithString:kServiceStoreLink];
NSString *descrStr = [NSString stringWithFormat:@"%@",captionKey];
[_pinterest createPinWithImageURL:imageUrl
sourceURL:sourceUrl
description:descrStr];
Pinterest sharing with App Pin
Sharing with Pinterest, via the share sheet, only allows you to share an image. If you look closer at the Pinterest iOS SDK, you're still limited to sharing the following details:
- Image URL
- Source web page
- Description
When you tell the SDK to pin the image + page, you are taken into the Pinterest app, and the rest is handled there.
The idea you're asking about is a deal between Apple and Pinterest. It seems possible to pin your app's iTunes URL in order to provide this special capability. I haven't seen any details about how this actually works. Is it possible from the share sheet? Maybe - try pinning from the iTunes website.
iOS application integration with pinterest
As of May 20th 2013, Pinterest have released an iOS SDK for pinning content.
Check out their Developers site for more information.
How to open Pinterest and Linked iOS app for share something?
Opening a Pinterest User Profile
- (IBAction)openPinterestUser:(id)sender {
// open the Pinterest App if available
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"pinterest://user/juliav1"]]) {
// opening the app didn't work - let's open Safari
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.pinterest.com/versluis2000/"]]) {
// nothing works - perhaps we're not online
NSLog(@"Dang!");
}
}
}
Opening a Pinterest Board
- (IBAction)openPinterestBoard:(id)sender {
// open the Pinterest App if available
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"pinterest://board/versluis2000/ios-projects"]]) {
// opening the app didn't work - let's open Safari
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.pinterest.com/versluis2000/ios-projects/"]]) {
// nothing works - perhaps we're not online
NSLog(@"Dang!");
}
}
}
Opening a Pinterest Pin
- (IBAction)openPinterestPin:(id)sender {
// open the Pinterest App if available
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"pinterest://pin/76279787413881109"]]) {
// opening the app didn't work - let's open Safari
if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.pinterest.com/pin/76279787413881109/"]]) {
// nothing works - perhaps we're not online
NSLog(@"Dang!");
}
}
}
Using Pintrest SDK
Pin methods
- (void)getPinWithIdentifier:(NSString *)pinId
fields:(NSSet *)fields
withSuccess:(PDKClientSuccess)successBlock
andFailure:(PDKClientFailure)failureBlock;
- (void)createPinWithImageURL:(NSURL *)imageURL
link:(NSURL *)link
onBoard:(NSString *)boardId
description:(NSString *)pinDescription
withSuccess:(PDKClientSuccess)successBlock
andFailure:(PDKClientFailure)failureBlock;
- (void)createPinWithImage:(UIImage *)image
link:(NSURL *)link
onBoard:(NSString *)boardId
description:(NSString *)pinDescription
progress:(PDKPinUploadProgress)progressBlock
withSuccess:(PDKClientSuccess)successBlock
andFailure:(PDKClientFailure)failureBlock;
Here is the Pintrest IOS SDK link pinterest/ios-pdk
1: https://github.com/pinterest/ios-pdk
The PinterestSDK for iOS will allow you to authenticate an account with Pinterest and make requests on behalf of the authenticated user. For details on the supported endpoint,visit the Pinterest API.
Custom URL scheme for Pinterest on iOS Safari to open board URL?
Looks like Pinterest has published an iOS SDK, and defined some URLS:
Pin
pinterest://pin/285063851385287883/
Board
pinterest://board/meaghanror/cats-cats-cats/
User
pinterest://user/carlrice/
See more at https://developers.pinterest.com/ios/
Related Topics
How to Catch an Exception in Swift
Write Data to Firebase in The Background After Retrieving Steps with Healthkit's Background Delivery
Add Custom .Colornames to UIcolor Somehow
Call Function on App Termination in Swift
How to Find The Top 3 Maximum Values in a Swift Dictionary
Turn Off Splash Screen When Using Flutterviewcontroller Within Existing Native App
Cannot Increment Beyond Endindex
Animate Line Under One Button to Another
Binary Search: Error in Passing Array
Communication Error When Uploading 90 Mb IPA File with Swift to Appstore
How to Get an Array of Days Between Two Dates in Swift
Add Assets to an Icloud Shared Photo Album Programmatically
Why Are Image Views Sometimes Not Appearing in Collection View Cells
How Make Polygon Without Intersection in Swift
Uisearchcontroller Hiding Status Bar on iOS 11 Swift 4
Issue with Optional Core Data Relationship Using Nspersistentcloudkitcontainer