2013-06-09 9 views
14

मैं अपने आवेदन में pinterest एकीकृत करना चाहता हूं। मैं अपने ऐप में pinterest के बटन को जोड़ना चाहता हूं जिसके माध्यम से मैं pinterest पर छवि अपलोड कर सकता हूं, मैं their Developers site का संदर्भ देता हूं लेकिन यह मेरी मदद नहीं करता है।आईओएस एप्लिकेशन में Pinterest को एकीकृत करने के लिए

मैं एसडीके शामिल करता हूं और उनके कोड की कोशिश करता हूं लेकिन यह मेरे लिए काम नहीं करता है।

#import <Pinterest/Pinterest.h> 

UIButton* pinItButton = [Pinterest pinItButton]; 
    [pinItButton addTarget:self 
        action:@selector(pinIt:) 
      forControlEvents:UIControlEventTouchUpInside]; 
    [self.view addSubview:pinItButton]; 

- (void)pinIt:(id)sender 
    { 
     [_pinterest createPinWithImageURL:@"http://placekitten.com/500/400" 
           sourceURL:@"http://placekitten.com" 
           description:@"Pinning from Pin It Demo"]; 
    } 

कृपया किसी भी मदद की सराहना की जाएगी।

अग्रिम धन्यवाद।

उत्तर

30

मुझे समझ में न क्या अपने वास्तविक समस्या लेकिन यहाँ मैं अपने अनुप्रयोग के लिए Pinterest एकीकृत करने के लिए कुछ आसान कदम प्रदान

कदम: 2 डाउनलोड: से here

कदम एक ग्राहक आईडी के लिए 1 रजिस्टर here से एसडीके और अपनी परियोजना में खींचें और छोड़ें।

कदम: 3 फिर आप Pinterest एप्लिकेशन से आपका ऐप्लिकेशन खोलने का समर्थन करने के लिए एक URL प्रकार जोड़ने के लिए, तो अपने plist फ़ाइल का URL प्रकार जोड़ने की आवश्यकता होगी

Example if your client id is 18571937652947: 
pin18571937652947 is the URL Scheme you need to support. 

कदम: 4 उपयोग करने के लिए Pinterest ढांचे आपको इसे अपनी फ़ाइल में आयात करने की आवश्यकता होगी।

#import <Pinterest/Pinterest.h> 

और अपने ज फ़ाइल में अपनी वस्तु की घोषणा

Pinterest *pinterest 

कदम: 5 आरंभ Pinterest वस्तु

pinterest = [[Pinterest alloc]initWithClientId:@"your app client id"] 

कदम: 6 में मानक PinIt बटन का उपयोग करने एक दृश्य इसे इस प्रकार जोड़ें:

UIButton* pinItButton = [Pinterest pinItButton]; 
    [pinItButton addTarget:self 
        action:@selector(pinIt:) 
      forControlEvents:UIControlEventTouchUpInside]; 
    [self.view addSubview:pinItButton]; 

कदम:

- (void)pinIt:(id)sender 
{ 
    NSURL *imageURL  = [NSURL URLWithString:@"http://placekitten.com/500/400"]; 
    NSURL *sourceURL = [NSURL URLWithString:@"http://placekitten.com"]; 


    [pinterest createPinWithImageURL:imageURL 
          sourceURL:sourceURL 
         description:@"Pinning from Pin It Demo"]; 
} 

नोट:: 7 आप कार्रवाई को संभालने के लिए इस का एक उदाहरण नीचे है की आवश्यकता होगी Pinterest एप्लिकेशन को आपके उपकरण में स्थापित किया जाना चाहिए अन्यथा इस कोड के लिए iTunes पर अनुप्रेषित Pinterest एप्लिकेशन

+3

ओह महान प्रयास धन्यवाद डाउनलोड मेरी समस्या का समाधान .. धन्यवाद ... –

+0

खुश मदद करने के लिए :) –

+0

@pratikbhiyani: धन्यवाद :) – Pratik

संबंधित मुद्दे