Spark
public class Spark
Spark object is the entry point to use this Cisco Spark iOS SDK. A Spark object must be created with one of the following Authenticator.
- OAuthAuthenticator - this should be used when the SDK is to be authenticated as a registered user to Cisco Spark cloud.
let clientId = "Def123456..."
let clientSecret = "fed456..."
let scope = "spark:all"
let redirectUri = "MyCustomApplication://response"
let authenticator = OAuthAuthenticator(clientId: clientId, clientSecret: clientSecret, scope: scope, redirectUri: redirectUri)
let spark = Spark(authenticator: authenticator)
...
if !authenticator.authorized {
authenticator.authorize(parentViewController: self) { success in
if !success {
print("User not authorized")
}
}
}
- JWTAuthenticator - this should be used when the SDK is to be authenticated as a guest user to Cisco Spark cloud.
let authenticator = JWTAuthenticator()
let spark = Spark(authenticator: authenticator)
...
if !authenticator.authorized {
authenticator.authorizedWith(jwt: myJwt)
}
Attention
All APIs on Cisco Spark iOS SDK are expected to run on the application’s main thread, unless specified otherwise.Since
1.2.0-
The version number of this Cisco Spark iOS SDK.
Since
1.2.0Declaration
Swift
public static let version: String
-
The logger for this SDK.
Since
1.2.0Declaration
Swift
public var logger: Logger? { get set }
-
Set the log level of the console logging.
Since
1.2.0Declaration
Swift
public var consoleLogger: LogLevel { get set }
-
This is the Authenticator object from the application when constructing this Spark object. It can be used to check and modify authentication state.
Since
1.2.0Declaration
Swift
public let authenticator: Authenticator
-
Phone represents a calling device in Cisco Spark iOS SDK. It can be used to make audio and video calls on Cisco Spark.
Since
1.2.0Declaration
Swift
public lazy var phone: Phone { get set }
-
MessageClient represent activities relates to the user. Use activities to create and manage the activities on behalf of the authenticated user.
Since
1.4.0Declaration
Swift
public lazy var messages: MessageClient { get set }
-
Constructs a new Spark object with an Authenticator.
Since
1.2.0Declaration
Swift
public init(authenticator: Authenticator)
Parameters
authenticator
The authentication strategy for this SDK.
-
Rooms are virtual meeting places in Cisco Spark where people post messages and collaborate to get work done. Use rooms to manage the rooms on behalf of the authenticated user.
Since
1.2.0See
Memberships API about how to manage people in a room.See
Messages API about how post or otherwise manage the content in a room.Declaration
Swift
public var rooms: RoomClient { get }
-
People are registered users of Cisco Spark. Use people to find a person on behalf of the authenticated user.
Since
1.2.0See
Memberships API about how to manage people in a room.See
Messages API about how post or otherwise manage the content in a room.Declaration
Swift
public var people: PersonClient { get }
-
Memberships represent a person’s relationships to rooms. Use membership to manage the authenticated user’s relationship to rooms.
Since
1.2.0See
Rooms API about how to manage rooms.See
Messages API about how post or otherwise manage the content in a room.Declaration
Swift
public var memberships: MembershipClient { get }
-
Webhooks allow the application to be notified via HTTP (or HTTPS?) when a specific event occurs in Cisco Spark, e.g. a new message is posted into a specific room. Use Webhooks to create and manage the webhooks for specific events.
Since
1.2.0Declaration
Swift
public var webhooks: WebhookClient { get }
-
Teams are groups of people with a set of rooms that are visible to all members of that team. Use teams to create and manage the teams on behalf of the authenticated user.
Since
1.2.0See
Team Memberships API about how to manage people in a team.See
Memberships API about how to manage people in a room.Declaration
Swift
public var teams: TeamClient { get }
-
Team Memberships represent a person’s relationships to teams. Use teamMemberships to create and manage the team membership on behalf of the authenticated user.
Since
1.2.0See
Teams API about how to manage teams.See
Rooms API about how to manage rooms.Declaration
Swift
public var teamMemberships: TeamMembershipClient { get }