Chat Room and Messages - TapUI
You can use these methods when implementing your app with TapUI to open a chat room when UI implementation type is used.
TapTalk UI Chat Room Method
Description
Creates room with user model. This method will return TapUIChatViewController
on success.
Creates room with TapTalk.io user ID. This method will return TapUIChatViewController
on success.
Creates room with client user ID. This method will return TapUIChatViewController
on success.
Creates room with room model. This method will return TapUIChatViewController
on success.
Creates room with room model. This method will return TapUIChatViewController
on success and scroll the view to the selected message.
Creates the active user's Saved Messages chat room. This method will return TapUIChatViewController
on success.
Create Personal Chat Room with User Model
#import <TapTalk/TapUI.h>
[TapUI sharedInstance] createRoomWithOtherUser:OTHER_USER success:^[(TapUIChatViewController * _Nonnull chatViewController) {
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}];
Create Personal Chat Room with TapTalk.io User ID
#import <TapTalk/TapUI.h>
[[TapUI sharedInstance] createRoomWithUserID:USER_ID
prefilledText:PREFILLED_TEXT
customQuoteTitle:CUSTOM_QUOTE_TITLE
customQuoteContent:CUSTOM_QUOTE_CONTENT
customQuoteImageURLString:CUSTOM_QUOTE_IMAGE_URL_STRING
userInfo:USER_INFO
success:^(TapUIChatViewController * _Nonnull chatViewController) {
// Successfully created chat room
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}
failure:^(NSError * _Nonnull error) {
// Failed open room
}];
Create Personal Chat Room with Client User ID
#import <TapTalk/TapUI.h>
[[TapUI sharedInstance] createRoomWithXCUserID:XC_USER_ID
prefilledText:PREFILLED_TEXT
customQuoteTitle:CUSTOM_QUOTE_TITLE
customQuoteContent:CUSTOM_QUOTE_CONTENT
customQuoteImageURLString:CUSTOM_QUOTE_IMAGE_URL_STRING
userInfo:USER_INFO
success:^(TapUIChatViewController * _Nonnull chatViewController) {
// Successfully created chat room
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}
failure:^(NSError * _Nonnull error) {
// Failed open room
}];
Create Room with Room Model
#import <TapTalk/TapUI.h>
[[TapUI sharedInstance] createRoomWithRoom:ROOM success:^(TapUIChatViewController * _Nonnull chatViewController) {
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}];
#import <TapTalk/TapUI.h>
[[TapUI sharedInstance] createRoomWithRoom:ROOM customQuoteTitle:CUSTOM_QUOTE_TITLE customQuoteContent:CUSTOM_QUOTE_CONTENT customQuoteImageURLString:CUSTOM_QUOTE_IMAGE_URL_STRING userInfo:USER_INFO success:^(TapUIChatViewController * _Nonnull chatViewController) {
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}];
Create Room with Room Model & Scroll to Selected Message
#import <TapTalk/TapUI.h>
[[TapUI sharedInstance] createRoomWithRoom:ROOM scrollToMessageWithLocalID:MESSAGE_LOCAL_ID] success:^(TapUIChatViewController * _Nonnull chatViewController) {
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}];
Create Saved Messages Chat Room
#import <TapTalk/TapUI.h>
[[TapUI sharedInstance] createSavedMessagesChatRoom:^(TapUIChatViewController * _Nonnull chatViewController) {
// Successfully created Saved Messages chat room
// You can choose to present or push view controller
// Present room list view
[self presentViewController:chatViewController animated:YES completion:^{
// Completion
}];
// Push room list view
[self.navigationController pushViewController:chatViewController animated:YES];
}
failure:^(NSError * _Nonnull error) {
// Failed to create room
}];
Last updated
Was this helpful?