Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

ios - FBSessionDelegate methods not firing -


i'm attempting implement latest facebook connect sdk , i'm having troubles. reason delegate callbacks fbsessiondelegate protocol not being fired. i've followed instructions on git facebook page , tried mimic facebook sample app no luck. i'm going crazy here i'm gonna post code , maybe see silly i've missed.

#import <foundation/foundation.h> #import "fbconnect.h"  @interface facebookwrapper : uiviewcontroller <fbsessiondelegate, fbrequestdelegate, fbdialogdelegate>{  facebook* _facebook;  nsarray* _permissions; }  @property(readonly) facebook *facebook;  - (void)login;  @end  #import "facebookwrapper.h"  static nsstring* kappid = @"1234455667778";  @implementation facebookwrapper  @synthesize facebook = _facebook;  - (id)init {  if (self = [super init]) {   _permissions =  [[nsarray arraywithobjects: @"read_stream", @"offline_access",nil] retain];   _facebook = [[facebook alloc] initwithappid:kappid];   }  return self; }  - (void)dealloc {  [_facebook release];  [_permissions release];  [super dealloc]; }  - (void)login {  [_facebook authorize:_permissions delegate:self]; }  - (void)fbdidlogin {  nslog(@"did log in"); }  - (void)fbdidnotlogin:(bool)cancelled {  nslog(@"failed log in"); }  - (void)fbdidlogout {  nslog(@"logged out"); } 

and call class,

facebookwrapper *fw = [[facebookwrapper alloc] init]; [fw login]; 

the behavior i'm seeing on phone expected. facebook app launches on init , permissions requested. phone brings app foreground delegates fbsessiondelegate never fired. i've tried in facebook sample app using app id , worked fine. have no idea difference is.

i figured out problem. in app delegate need override handleopenurl.

- (bool)application:(uiapplication *)application handleopenurl:(nsurl *)url {     return [[facebookwrapper facebook] handleopenurl:url]; } 

if you're creating wrapper class you'll need instance of in app delegate can call hanleopenurl method in facebook class. notice there public readonly property facebook instance in facebookwrapper class can call handlopenurl.

by doing app know continue when returns getting permissions inside of facebook app.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -