2012-07-02 4 views
2

나는 텀블러/트위터/페이스 북/기타 소셜 사이트 사이트에서 내 텍스트 (문자열)를 공유하지 않을 것입니다.내 텍스트를 공유하는 방법 소셜 네트워킹 사이트에서 이모티콘을 사용 하시겠습니까?

나는 그것을 어떻게 공유 해야할지 모르겠다. 어떤 사람이 생각이나 샘플 코드를 가질 수 있습니까?

제발 도와주세요.

미리 감사드립니다.

+0

문제를 해결하십시오. 조사하고 배우기 위해 필요한 다른 작업은 무엇입니까? –

답변

3

이모티콘 키보드를 공유하려는 경우 여기에서 확인하십시오. http://www.easyapns.com/blog 공유 할 소셜 프레임 워크.

-(void)openFBController 
{ 


SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; 

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook] == NO) { 
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"This device is not able to Share Facebook or Facebook account is not configured." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    [alert show]; 

} 

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) 
{ 
    SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){ 

     [fbController dismissViewControllerAnimated:YES completion:nil]; 

     switch(result){ 
      case SLComposeViewControllerResultCancelled: 
      default: 
      { 
       NSLog(@"Cancelled....."); 

      } 
       break; 
      case SLComposeViewControllerResultDone: 
      { 
       NSLog(@"Posted...."); 

       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"PeekAboo!" message:@"Post Successfully." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
       [alert show]; 
      } 
       break; 
     }}; 

    [fbController addImage:[UIImage imageNamed:@"@"give ur imagename""]]; 
    [fbController setInitialText:@"give ur text"]; 

    [fbController addURL:[NSURL URLWithString:@"give ur url"]]; 
    [fbController setCompletionHandler:completionHandler]; 
    [self presentViewController:fbController animated:YES completion:nil]; 
} 


//Note:It doesn't show the old albums list to select in fbController in my account, 
//I don't know if thats the case with other people as well. 
//After I created and transfered the data from FB to device FB. 
//All the albums created afterwards were shown in the list. 

} 


- (void)canTweetStatus { 


SLComposeViewController *TweetStatusController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter]; 

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter] == NO) { 
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"This device is not able to Share Twitter or Twitter account is not configured." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    [alert show]; 

} 


if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) 
{ 
    SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){ 

     [TweetStatusController dismissViewControllerAnimated:YES completion:nil]; 

     switch(result){ 
      case SLComposeViewControllerResultCancelled: 
      default: 
      { 
       NSLog(@"Cancelled....."); 

      } 
       break; 
      case SLComposeViewControllerResultDone: 
      { 
       NSLog(@"Posted...."); 
       UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"PeekAboo!" message:@"Post Successfully." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; 
       [alert show]; 
      } 
       break; 
     }}; 

    [TweetStatusController addImage:[UIImage imageNamed:@"icon.png"]]; 
    [TweetStatusController setInitialText:@"give ur text"]; 
    [TweetStatusController addURL:@"give ur url"]]; 
    [TweetStatusController setCompletionHandler:completionHandler]; 
    [self presentViewController:TweetStatusController animated:YES completion:nil]; 
} 


} 
관련 문제