BBURLManager

BBURLManager is a singleton which provides its delegate with the ability to customize how the application deals with certain types of URLs. The types of URLs which you can intercept and provide a customized experience include:

  • http, https, and other web links included in chats and posts

  • File attachments in chats and posts (such as PDF, XLS and other non-image attachments)

  • Forced update AppStore URLs

Setting the BBURLManagerDelegate is easy. All the methods of BBURLManagerDelegate are optional, and if they are not implemented, the app will handle the situation in a default manner, which typically involves opening the URL/Attachment inside the application. See BBURLManagerDelegate for the full list of methods.

BBURLManager
BBURLManager
@interface BBURLManager : NSObject
+ (instancetype)sharedInstance;
@property (nonatomic, weak) id <BBURLManagerDelegate> urlManagerDelegate;
@end

When setting the BBURLManagerDelegate, use the shared instance.

The BBURLManagerDelegate can be set or cleared at anytime.

Methods

sharedInstance
sharedInstance
+ (instancetype)sharedInstance;

sharedInstance You should not call BBURLManager alloc init to get a copy of the BBURLManager. Instead use BBURLManager sharedInstance. Returns the shared instance of BBURLManager. Using your own copy of BBURLManager may seem to work, but many features of the app will not behave correctly.

Properties

setURLManagerDelegate
setURLManagerDelegate
@property (nonatomic, weak) id <BBURLManagerDelegate> urlManagerDelegate;

setURLManagerDelegate

This should only be called on the main thread/queue.

  • delegate Instantiate a class that implements one or more of the methods of the BBURLManagerDelegate and set it on the shared instance of the BBURLManager.