Getting the Inbox with the iOS SDK
Organizations - (TTOrganization)
Organizations represents a context where users exists and conversations take place, you can think of organizations as different inboxes.
Get organizations
Objective-C
NSFetchResultsController *fetchController = [[TTKit sharedInstance] organizationsFetchControllerWithDelegate:delegate];NSArray *organizations = [fetchController fetchedObjects];
Swift
let frc = TTKit.sharedInstance().organizationsFetchController(with: self)
Conversations - (TTRosterEntry)
After authenticating, the SDK will fetch all the recent conversations associated with the user and persist them in our local datastore. We use NSFetchResultsControllers
to get your messages and register for any changes.
Inbox - Get Conversations for current organization
Using a NSFetchResultsController
you can get a list of TTRosterEntry
objects (TTRosterEntry
represents a conversation) for the current set organization or all roster entry objects for all organizations.
Objective-C
NSFetchResultsController *fetchController = [[TTKit sharedInstance] organizationsFetchControllerWithDelegate:delegate];NSArray *rosterEntires = [fetchController fetchedObjects];
Swift
let frc = TTKit.sharedInstance().rosterFetchController(with: self)