Skip to content

Commit b34cddf

Browse files
committed
Tidy up README
1 parent dc89767 commit b34cddf

File tree

1 file changed

+5
-54
lines changed

1 file changed

+5
-54
lines changed

README.md

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ What else would you want? Head over to the example app [ViewController.swift](ht
2222
* [Connection delegate](#connection-delegate)
2323
* [Reconnection](#reconnection)
2424
* [Subscribing to channels](#subscribing)
25+
* [Public channels](#public-channels)
26+
* [Private channels](#private-channels)
27+
* [Presence channels](#presence-channels)
2528
* [Binding to events](#binding-to-events)
2629
* [Globally](#global-events)
2730
* [Per-channel](#per-channel-events)
2831
* [Receiving errors](#receiving-errors)
29-
* [Presence channel specifics](#presence-channel-specifics)
3032
* [Push notifications](#push-notifications)
3133
* [Pusher delegate](#pusher-delegate)
3234
* [Testing](#testing)
@@ -465,6 +467,8 @@ let myPrivateChannel = pusher.subscribe("private-my-channel")
465467
PusherChannel *myPrivateChannel = [pusher subscribeWithChannelName:@"private-my-channel"];
466468
```
467469
470+
Subscribing to private channels involves the client being authenticated. See the [Configuration](#configuration) section for the authenticated channel example for more information.
471+
468472
### Presence channels
469473
470474
Presence channels are channels whose names are prefixed by `presence-`.
@@ -742,59 +746,6 @@ NSString *callbackId = [chan bindWithEventName:@"new-price" callback:^void (NSDi
742746
You can unbind from events at both the global and per channel level. For both objects you also have the option of calling `unbindAll`, which, as you can guess, will unbind all eventHandlers on the object.
743747
744748
745-
## Presence channel specifics
746-
747-
Presence channels have some extra properties and functions available to them. In particular you can access the members who are subscribed to the channel by calling `members` on the channel object, as below.
748-
749-
#### Swift
750-
```swift
751-
let chan = pusher.subscribe("presence-channel")
752-
753-
print(chan.members)
754-
```
755-
756-
#### Objective-C
757-
```objc
758-
PusherPresenceChannel *presChanExplicit = [pusher subscribeToPresenceChannelWithChannelName:@"presence-explicit"];
759-
760-
NSArray *members = [presChanExplicit members];
761-
```
762-
763-
You can also search for specific members in the channel by calling `findMember` and providing it with a user id string.
764-
765-
#### Swift
766-
```swift
767-
let chan = pusher.subscribe("presence-channel")
768-
let member = chan.findMember(userId: "12345")
769-
770-
print(member)
771-
```
772-
773-
#### Objective-C
774-
```objc
775-
PusherPresenceChannel *presChanExplicit = [pusher subscribeToPresenceChannelWithChannelName:@"presence-explicit"];
776-
777-
PusherPresenceChannelMember *me = [presChanExplicit findMemberWithUserId:@"12345"];
778-
```
779-
780-
As a special case of `findMember` you can call `me` on the channel to get the member object of the subscribed client.
781-
782-
#### Swift
783-
```swift
784-
let chan = pusher.subscribeToPresenceChannel(channelName: "presence-channel")
785-
let me = chan.me()
786-
787-
print(me)
788-
```
789-
790-
#### Objective-C
791-
```objc
792-
PusherPresenceChannel *presChanExplicit = [pusher subscribeToPresenceChannelWithChannelName:@"presence-explicit"];
793-
794-
PusherPresenceChannelMember *me = [presChanExplicit me];
795-
```
796-
797-
798749
## Push notifications
799750
800751
Pusher also supports push notifications. Instances of your application can register for push notifications and subscribe to "interests". Your server can then publish to those interests, which will be delivered to your application as push notifications. See [our guide to setting up push notifications for iOS](https://pusher.com/docs/push_notifications/ios) for a friendly introduction.

0 commit comments

Comments
 (0)