CPSmsService
@objc
public class CPSmsService : MessageService, CPServiceProtocol
This class is used to manage SMS services such as sending and receiving SMS messages.
-
Returns Sms DID address list.
Declaration
Swift
@objc public private(set) var localAddressList: [String] { get }
-
An application that needs notifications should implement an SmsDelegate compliant class and set this member as an instance of that class.
Declaration
Swift
@objc public var delegate: CPSmsDelegate?
-
Initializes SmsService instance with given configuration.
Declaration
Swift
public init(userInfo: CPUserInfo, info: CPServiceInfo)
Parameters
userInfo
The configuration instance which sms service will use.
info
Service information specifying service type and options.
-
Public interface to create an SMS conversation object derived from the Conversation base class.
Declaration
Swift
@objc public func createConversation(fromAddress: String, withParticipant: String) -> CPConversation?
Parameters
fromAddress
The address from which this message should originate.
withParticipant
SIP URI of remote conversation participant.
Return Value
Object of type SmsConversation derived from Conversation class.
-
Public interface to fetch conversations between remote address and all local addresses of current user.
Declaration
Swift
@objc override public func fetchConversations(withFetchCriteria: FetchCriteria, completion: @escaping FetchBlock)
Parameters
withParticipant
SIP URI of remote conversation participant.
Return Value
Object of type SmsConversations derived from Conversation class.
-
Delegate method to get a service’s information
Declaration
Swift
public func serviceInfo() -> CPServiceInfo
Return Value
service information object with service type and preferences.
-
Delegate method to get a list of notfications the service expects
Declaration
Swift
public func notifications() -> [String]
Return Value
list of notification names. These should match what is returned by subscribe() in completion callback.
-
Delegate method to subscribe for notifications from a remote channel
Declaration
Swift
public func subscribe(channelID: String, completion: @escaping SubscribeCompletion)
Parameters
channelID
The channel on which to subscribe for notifications.
completion
Code block to execute upon subscription completion.
-
Delegate method to unsubscribe for notifications
Declaration
Swift
public func unsubscribe(channelID: String, completion: @escaping UnsubscribeCompletion)
Parameters
channelID
The channel from which to unsubscribe for notifications.
completion
Code block to execute upon subscription completion.