@@ -15,6 +15,8 @@ open class PusherChannels: NSObject {
15
15
16
16
- parameter name: The name of the channel to create
17
17
- parameter connection: The connection associated with the channel being created
18
+ - parameter auth: A PusherAuth value if subscription is being made to an
19
+ authenticated channel without using the default auth methods
18
20
- parameter onMemberAdded: A function that will be called with information about the
19
21
member who has just joined the presence channel
20
22
- parameter onMemberRemoved: A function that will be called with information about the
@@ -25,6 +27,7 @@ open class PusherChannels: NSObject {
25
27
internal func add(
26
28
name: String ,
27
29
connection: PusherConnection ,
30
+ auth: PusherAuth ? = nil ,
28
31
onMemberAdded: ( ( PusherPresenceChannelMember ) -> ( ) ) ? = nil ,
29
32
onMemberRemoved: ( ( PusherPresenceChannelMember ) -> ( ) ) ? = nil ) -> PusherChannel {
30
33
if let channel = self . channels [ name] {
@@ -35,11 +38,12 @@ open class PusherChannels: NSObject {
35
38
newChannel = PusherPresenceChannel (
36
39
name: name,
37
40
connection: connection,
41
+ auth: auth,
38
42
onMemberAdded: onMemberAdded,
39
43
onMemberRemoved: onMemberRemoved
40
44
)
41
45
} else {
42
- newChannel = PusherChannel ( name: name, connection: connection)
46
+ newChannel = PusherChannel ( name: name, connection: connection, auth : auth )
43
47
}
44
48
self . channels [ name] = newChannel
45
49
return newChannel
@@ -52,6 +56,8 @@ open class PusherChannels: NSObject {
52
56
53
57
- parameter channelName: The name of the channel to create
54
58
- parameter connection: The connection associated with the channel being created
59
+ - parameter auth: A PusherAuth value if subscription is being made to an
60
+ authenticated channel without using the default auth methods
55
61
- parameter onMemberAdded: A function that will be called with information about the
56
62
member who has just joined the presence channel
57
63
- parameter onMemberRemoved: A function that will be called with information about the
@@ -62,6 +68,7 @@ open class PusherChannels: NSObject {
62
68
internal func addPresence(
63
69
channelName: String ,
64
70
connection: PusherConnection ,
71
+ auth: PusherAuth ? = nil ,
65
72
onMemberAdded: ( ( PusherPresenceChannelMember ) -> ( ) ) ? = nil ,
66
73
onMemberRemoved: ( ( PusherPresenceChannelMember ) -> ( ) ) ? = nil ) -> PusherPresenceChannel {
67
74
if let channel = self . channels [ channelName] as? PusherPresenceChannel {
@@ -70,6 +77,7 @@ open class PusherChannels: NSObject {
70
77
let newChannel = PusherPresenceChannel (
71
78
name: channelName,
72
79
connection: connection,
80
+ auth: auth,
73
81
onMemberAdded: onMemberAdded,
74
82
onMemberRemoved: onMemberRemoved
75
83
)
0 commit comments