Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIMOB-9878 Update to latest version of FB's API for continued functional... #2530

Merged
merged 2 commits into from
Jul 12, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
63 changes: 32 additions & 31 deletions iphone/Classes/FBConnect/FBDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,49 @@
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol FBDialogDelegate2;
@protocol FBDialogDelegate;
@class FBFrictionlessRequestSettings;

/**
* Do not use this interface directly, instead, use dialog in Facebook.h
*
* Facebook dialog interface for start the facebook webView UIServer Dialog.
*/

@interface FBDialog2 : UIView <UIWebViewDelegate> {
id<FBDialogDelegate2> _delegate;
NSMutableDictionary *_params;
NSString * _serverURL;
NSURL* _loadingURL;
UIWebView* _webView;
UIActivityIndicatorView* _spinner;
UIImageView* _iconView;
UILabel* _titleLabel;
UIButton* _closeButton;
UIDeviceOrientation _orientation;
BOOL _showingKeyboard;
@interface FBDialog : UIView <UIWebViewDelegate> {
id<FBDialogDelegate> _delegate;
NSMutableDictionary *_params;
NSString * _serverURL;
NSURL* _loadingURL;
UIWebView* _webView;
UIActivityIndicatorView* _spinner;
UIButton* _closeButton;
UIInterfaceOrientation _orientation;
BOOL _showingKeyboard;
BOOL _isViewInvisible;
FBFrictionlessRequestSettings* _frictionlessSettings;

// Ensures that UI elements behind the dialog are disabled.
UIView* _modalBackgroundView;
}

/**
* The delegate.
*/
@property(nonatomic,assign) id<FBDialogDelegate2> delegate;
@property(nonatomic,assign) id<FBDialogDelegate> delegate;

/**
* The parameters.
*/
@property(nonatomic, retain) NSMutableDictionary* params;

/**
* The title that is shown in the header atop the view.
*/
@property(nonatomic,copy) NSString* title;

- (NSString *) getStringFromUrl: (NSString*) url needle:(NSString *) needle;

- (id)initWithURL: (NSString *) loadingURL
params: (NSMutableDictionary *) params
delegate: (id <FBDialogDelegate2>) delegate;
- (id)initWithURL: (NSString *) loadingURL
params: (NSMutableDictionary *) params
isViewInvisible: (BOOL) isViewInvisible
frictionlessSettings: (FBFrictionlessRequestSettings *) frictionlessSettings
delegate: (id <FBDialogDelegate>) delegate;

/**
* Displays the view with an animation.
Expand Down Expand Up @@ -118,48 +119,48 @@
///////////////////////////////////////////////////////////////////////////////////////////////////

/*
*Your application should implement this delegate
*Your application should implement this delegate
*/
@protocol FBDialogDelegate2 <NSObject>
@protocol FBDialogDelegate <NSObject>

@optional

/**
* Called when the dialog succeeds and is about to be dismissed.
*/
- (void)dialogDidComplete:(FBDialog2 *)dialog;
- (void)dialogDidComplete:(FBDialog *)dialog;

/**
* Called when the dialog succeeds with a returning url.
*/
- (void)dialogCompleteWithUrl:(NSURL *)url;

/**
* Called when the dialog get cancelled by the user.
* Called when the dialog get canceled by the user.
*/
- (void)dialogDidNotCompleteWithUrl:(NSURL *)url;

/**
* Called when the dialog is cancelled and is about to be dismissed.
*/
- (void)dialogDidNotComplete:(FBDialog2 *)dialog;
- (void)dialogDidNotComplete:(FBDialog *)dialog;

/**
* Called when dialog failed to load due to an error.
*/
- (void)dialog:(FBDialog2*)dialog didFailWithError:(NSError *)error;
- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError *)error;

/**
* Asks if a link touched by a user should be opened in an external browser.
*
* If a user touches a link, the default behavior is to open the link in the Safari browser,
* If a user touches a link, the default behavior is to open the link in the Safari browser,
* which will cause your app to quit. You may want to prevent this from happening, open the link
* in your own internal browser, or perhaps warn the user that they are about to leave your app.
* If so, implement this method on your delegate and return NO. If you warn the user, you
* should hold onto the URL and once you have received their acknowledgement open the URL yourself
* using [[UIApplication sharedApplication] openURL:].
*/
- (BOOL)dialog:(FBDialog2*)dialog shouldOpenURLInExternalBrowser:(NSURL *)url;
- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL *)url;

@end
#endif
#endif