To receive messages from the channel group, subscribe to the channel group created in the previous step.
Click to copy the blue snippets and then paste them into your code.import UIKit import PubNub import PubNubBridge @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? var client: PubNub? func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { self.client = PubNub.client() self.client?.addChannels(["announcements", "lobby"], toGroup: "tradeshow", withCompletion: {[weak self] (status) -> Void in // Check whether request successfully completed or not. if !status.error { withExtendedLifetime(self) { self!.client?.addListener(self!) self!.client?.subscribeToChannelGroups(["tradeshow"], withPresence: false) } } else { // Handle channels list modification for group error. Check 'category' property // to find out possible reason because of which request did fail. // Review 'errorData' property (which has PNErrorData data type) of status // object to get additional information about issue. // // Request can be resent using: status.retry() } }) return true } }