PTChannelManager Discrepancies in Documentation

Hello, I am reading up on the documentation and seems to have some discrepancies but wanted to double check. In Overview for PTChannelManager, it states "Multiple calls to channelManager(delegate:restorationDelegate:completionHandler:) result in the system returning the same shared instance, so store the channel manager in an instance variable." https://developer.apple.com/documentation/pushtotalk/ptchannelmanager

However if we look at the documentation for creation of a channel manager, in the completionHandler, it states that it will return "A new channel manager instance." https://developer.apple.com/documentation/pushtotalk/ptchannelmanager/4031737-channelmanager

So is it a shared instance that gets returned or will a new instance be created? Need to know if we will need to implement a multiDelegate Pattern or not for this scenario for example if someone else called this function, would they take over the callbacks or would they get their own instance? Thank you.

Replies

The first time that you call channelManager(delegate:restorationDelegate:completionHandler:) the method will initialize and return a new PTChannelManager. Subsequent calls to this method within the same process result in the system returning the same shared PTChannelManager instance without any changes to its delegates. This is why the documentation suggests that you store the PTChannelManager in an instance variable after it’s been initialized.