iPhone fotoğraf yüklemek için bağlanmak facebook kullanımına ilişkin süreci Documented

oy
1

baktıktan sonra ben facebook forumlarında bu yazı genelinde geldi:

bağlantı

Bunlar dinle nesnesini bir UIImage besleme vardır. Bu mantıklı görünüyor, ama bu nereye belgelenmiştir? API belgeleri tüm platformlar için genelleştirilmiş edilir. Nerede argümanlar ve bunların veri türleri için iPhone özgü gereksinimleri nelerdir?

Teşekkürler

****** Güncelleme ***** Hala Kakao ait herhangi bir API docs rastladı değil. Ben, ancak, ben forumu bilgileri, Facebook örnek kodlar ve Yapıştırıcınız araya ekleme tarafından gerekli bilgileri toplamak etmedi.

Umarım önümüzdeki birkaç aydan biraz daha somut bir şeyler yaparız.

Oluştur 15/04/2009 saat 05:39
kaynak kullanıcı
Diğer dillerde...                            


3 cevaplar

oy
-2

Joe Hewitt (Facebook iPhone uygulaması yazarı) onun three20'yi çerçeve olarak Facebook uygulamasının büyük parçalar yayınladı. Bu barındırılan github .

Cevap 15/04/2009 saat 07:51
kaynak kullanıcı

oy
6

Tamamlamak için:

Aşağıdaki Facebook Connect ile etkileşim açıklar: https://developers.facebook.com/docs/guides/web/

API çağrıları: https://developers.facebook.com/docs/reference/api/

Genişletilmiş İzinleri gerekirse: https://developers.facebook.com/docs/guides/policy/examples_and_explanations/Extended_Permissions/

Mobil Orchard üzerinde güzel bir Obj-C sarıcı: http://www.mobileorchard.com/marketing-in-code-part-2-setting-a-users-status-in-facebook-from-an-iphone-app- a-öğretici /

Aşağıda, bir SessionViewController benim uygulamasıdır:

#import "SessionViewController.h"
#import "FBConnect.h"
#import "FBFeedDialog.h"

///////////////////////////////////////////////////////////////////////////////////////////////////
// This application will not work until you enter your Facebook application's API key here:

static NSString* kApiKey = @"XXXXXXXXXXXXXXXXXX";

// Enter either your API secret or a callback URL (as described in documentation):
static NSString* kApiSecret = @"XXXXXXXXXXXXXXXXXX"; // @"<YOUR SECRET KEY>";

///////////////////////////////////////////////////////////////////////////////////////////////////

@implementation SessionViewController

@synthesize label = _label;
@synthesize anImage;

- (void)done:(id)sender{

    [self dismissModalViewControllerAnimated:YES];


}

///////////////////////////////////////////////////////////////////////////////////////////////////
// NSObject

- (id)init {
    if (self = [super init]) {
        _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];
    }
    return self;
}


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
  if (self = [super initWithNibName:@"SessionViewController" bundle:nibBundleOrNil]) {
      _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain];

  }
  return self;
}

- (void)dealloc {
    [_session release];
    [anImage release];
    [super dealloc];
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// UIViewController

- (void)viewDidLoad {
  [_session resume];
  _loginButton.style = FBLoginButtonStyleWide;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  return NO;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// FBDialogDelegate

- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError*)error {
  _label.text = [NSString stringWithFormat:@"Error(%d) %@", error.code,
    error.localizedDescription];
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// FBSessionDelegate

- (void)session:(FBSession*)session didLogin:(FBUID)uid {
  _permissionButton.hidden = NO;
  _feedButton.hidden = NO;

  NSString* fql = [NSString stringWithFormat:
    @"select uid,name from user where uid == %lld", session.uid];

  NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];
  [[FBRequest requestWithDelegate:self] call:@"facebook.fql.query" params:params];
}

- (void)sessionDidLogout:(FBSession*)session {
  _label.text = @"";
  _permissionButton.hidden = YES;
  _feedButton.hidden = YES;
}

///////////////////////////////////////////////////////////////////////////////////////////////////
// FBRequestDelegate

- (void)request:(FBRequest*)request didLoad:(id)result {

    if([result isKindOfClass:[NSArray class]]){
        NSArray* users = result;
        NSDictionary* user = [users objectAtIndex:0];
        NSString* name = [user objectForKey:@"name"];
        _label.text = [NSString stringWithFormat:@"Logged in as %@", name];
    }  

}

- (void)request:(FBRequest*)request didFailWithError:(NSError*)error {
  _label.text = [NSString stringWithFormat:@"Error(%d) %@", error.code,
    error.localizedDescription];
}

///////////////////////////////////////////////////////////////////////////////////////////////////

- (IBAction)askPermissionForPhotoUpload:(id)target {
    FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
    dialog.delegate = self;
    dialog.permission = @"photo_upload";
    [dialog show];
}
- (IBAction)publishPhoto:(id)target{

    NSMutableDictionary *args = [[[NSMutableDictionary alloc] init] autorelease];
    [args setObject:self.anImage forKey:@"image"];  
    FBRequest *uploadPhotoRequest = [FBRequest requestWithDelegate:self];
    [uploadPhotoRequest call:@"photos.upload" params:args];
}


- (void)askPermission:(id)target {
  FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
  dialog.delegate = self;
  dialog.permission = @"status_update";
  [dialog show];
}

- (void)publishFeed:(id)target {
  FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease];
  dialog.delegate = self;
  dialog.templateBundleId = 9999999;
  dialog.templateData = @"{\"key1\": \"value1\"}";
  [dialog show];
}

@end
Cevap 16/12/2009 saat 18:24
kaynak kullanıcı

Cevap 28/06/2011 saat 13:41
kaynak kullanıcı

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more