DimeloDelegate Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | Dimelo.h |
Overview
The DimeloDelegate
protocol allows you to react to remote notifications,
display network activity progress and react to events created by the chat views.
– onOpen:
Called when the chat view is opened.
- (void)onOpen:(Dimelo *)dimelo
Parameters
dimelo |
A |
---|
Discussion
To get authentification data, and context data ... when the chat view is just opened
Declared In
Dimelo.h
– onClose:
Called when the chat view is closed.
- (void)onClose:(Dimelo *)dimelo
Parameters
dimelo |
A |
---|
Discussion
To get authentification data, and context data ... when the chat view is just closed
Declared In
Dimelo.h
– handleRemoteNotificationWithIdentifier:responseInfo:
Called when reply notification is called.
- (void) handleRemoteNotificationWithIdentifier: (NSString*)identifier responseInfo:(NSDictionary*)responseInfo
Parameters
identifier |
|
---|---|
responseInfo |
Discussion
To add the interactive push notification with direct reply
Declared In
Dimelo.h
– dimeloDisplayChatViewController:
required method
Asks to display the chat view controller.
- (void)dimeloDisplayChatViewController:(Dimelo *)dimelo
Parameters
dimelo |
An API instance. |
---|
Discussion
You may use an existing instance or create a new one using [Dimelo chatViewController]
.
Typical ways to display a chat view controller:
Modally, using [UIViewController presentViewController:animated:completion:].
In a tab view, by switching to an existing tab.
Using popover on iPad.
This method is required as it is the only way for Dimelo
to know how to
display a chat view controller in response to remote notifications.
Declared In
Dimelo.h
– dimelo:shouldDisplayNotificationWithText:
Asks if a notification bar should be displayed.
- (BOOL)dimelo:(Dimelo *)dimelo shouldDisplayNotificationWithText:(NSString *)message
Parameters
dimelo |
An API instance. |
---|---|
message |
A message to be displayed in the notification. If you override Dimelo notification bar, you may use this text to display in your own notification. |
Return Value
YES
to allow notification.
NO
if you want to display custom UI or simply ignore this notification.
Discussion
By default, a standard notification slides from the top. When the user taps it,
the chat view is opened (via dimeloDisplayChatViewController:
).
Declared In
Dimelo.h
– dimeloDidBeginNetworkActivity:
Called when a network activity started.
- (void)dimeloDidBeginNetworkActivity:(Dimelo *)dimelo
Parameters
dimelo |
An |
---|
Discussion
This is provided so your app could show status bar spinner
using [UIApplication networkActivityIndicatorVisible]
.
This method can be called multiple times, for each network request.
Every call is guaranteed to be eventually balanced by dimeloDidEndNetworkActivity:
.
Declared In
Dimelo.h
– dimeloDidEndNetworkActivity:
Called when a network activity ended.
- (void)dimeloDidEndNetworkActivity:(Dimelo *)dimelo
Parameters
dimelo |
A |
---|
Discussion
This is provided so your app could hide status bar spinner
using [UIApplication networkActivityIndicatorVisible]
.
This method can be called multiple times, for each network request.
This call is guaranteed to balance every dimeloDidBeginNetworkActivity:
.
Declared In
Dimelo.h
– dimeloUnreadCountDidChange:
Called when [Dimelo unreadCount]
property changes.
- (void)dimeloUnreadCountDidChange:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatUnreadCountDidChangeNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloWelcomeMessageDidChange:
Called when [Dimelo welcomeMessage]
property changes.
- (void)dimeloWelcomeMessageDidChange:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloWelcomeMessageDidChangeNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloChatDidSendMessage:
Called when the user sends a message.
- (void)dimeloChatDidSendMessage:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatDidSendMessageNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloChatDidReceiveNewMessages:
Called when chat receives new messages from the server (even while the chat is not visible).
- (void)dimeloChatDidReceiveNewMessages:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatDidReceiveNewMessagesNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloChatWillAppear:
Called when the chat view is about to be displayed.
- (void)dimeloChatWillAppear:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatWillAppearNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloChatDidAppear:
Called when the chat view is displayed (animation completed).
- (void)dimeloChatDidAppear:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatDidAppearNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloChatWillDisappear:
Called when the chat view is about to be closed.
- (void)dimeloChatWillDisappear:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatWillDisappearNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h
– dimeloChatDidDisappear:
Called when the chat view is closed (animation completed).
- (void)dimeloChatDidDisappear:(NSNotification *)notification
Parameters
notification |
NSNotification with name DimeloChatDidDisappearNotification. |
---|
Discussion
Provided as a courtesy so that you do not need to subscribe to notifications separately when handling these events in one delegate is enough for your use case.
Declared In
Dimelo.h