Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/docs/auth/basic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ARTRest *rest = [[ARTRest alloc] initWithKey:@"{{API_KEY}}"];
```

```realtime_csharp
AblyRealtime realtime = AblyRealtime("{{API_KEY}}");
AblyRealtime realtime = new AblyRealtime("{{API_KEY}}");
```

```rest_csharp
Expand Down
4 changes: 3 additions & 1 deletion src/pages/docs/channels/options/encryption.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ The following is an example of setting encryption when obtaining a channel insta
```

```realtime_csharp
// Requires: using IO.Ably.Encryption;
byte[] key = Crypto.GenerateRandomKey();
ChannelOptions options = new ChannelOptions(key);
IRealtimeChannel channel = realtime.Channels.Get("{{RANDOM_CHANNEL_NAME}}", options);
Expand Down Expand Up @@ -222,7 +223,8 @@ channel
```

```rest_csharp
AblyRest rest = new Ably.Rest('{{API_KEY}}');
// Requires: using IO.Ably.Encryption;
AblyRest rest = new AblyRest("{{API_KEY}}");
byte[] key = Crypto.GenerateRandomKey();
ChannelOptions options = new ChannelOptions(key);
IRestChannel channel = rest.Channels.Get("{{RANDOM_CHANNEL_NAME}}", options);
Expand Down
4 changes: 3 additions & 1 deletion src/pages/docs/channels/options/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Channel channel = realtime.channels.get("{{RANDOM_CHANNEL_NAME}}", options);
```

```realtime_csharp
// Requires: using IO.Ably.Encryption;
byte[] key = Crypto.GenerateRandomKey();
CipherParams cipherParams = Crypto.GetDefaultParams(key);
ChannelOptions channelOpts = new ChannelOptions(cipherParams);
Expand Down Expand Up @@ -118,7 +119,8 @@ const channel = rest.channels.get('{{RANDOM_CHANNEL_NAME}}', {cipher: {key: ciph
```

```rest_csharp
AblyRest rest = new Ably.Rest('{{API_KEY}}');
// Requires: using IO.Ably.Encryption;
AblyRest rest = new AblyRest("{{API_KEY}}");
byte[] key = Crypto.GenerateRandomKey();
ChannelOptions options = new ChannelOptions(key);
IRestChannel channel = rest.Channels.Get("{{RANDOM_CHANNEL_NAME}}", options);
Expand Down
6 changes: 3 additions & 3 deletions src/pages/docs/channels/states.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ channel.detach();
```

```realtime_csharp
Channel.Detach();
channel.Detach();
channel.On(ChannelEvent.Detached, stateChange => {
Console.WriteLine("detached from the channel " + channel.Name)
Console.WriteLine("detached from the channel " + channel.Name);
});
```

Expand Down Expand Up @@ -259,7 +259,7 @@ channel.on(ChannelEvent.attached, new ChannelStateListener() {
IRealtimeChannel channel = realtime.Channels.Get("chatroom");
channel.On(ChannelEvent.Attached, stateChange => {
Console.WriteLine("channel " + channel.Name + " is now attached");
if (stateChange.resumed) {
if (stateChange.Resumed) {
Console.WriteLine("Message continuity was preserved");
} else {
Console.WriteLine("Message continuity was not preserved");
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/connect/states.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ The `Connection` object can also emit an event that is not a state change: an `u
```

```realtime_csharp
realtime.Connection.On(ConnectionState.Connected, args => {
Console.WriteLine("Connected to Ably!")
realtime.Connection.On(ConnectionEvent.Connected, args => {
Console.WriteLine("Connected to Ably!");
});
```

Expand Down
14 changes: 8 additions & 6 deletions src/pages/docs/pub-sub/advanced.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1023,9 +1023,10 @@ message.id = "unique123";
```

```realtime_csharp
ARTRealtime *realtime = [[ARTRealtime alloc] initWithKey:@"{{API_KEY}}"];
ARTRealtimeChannel *channel = [realtime.channels get:@"{{RANDOM_CHANNEL_NAME}}"];
channel publish:@"example" data:@"payload" id:@"unique123" callback:^(ARTErrorInfo *error)
AblyRealtime realtime = new AblyRealtime("{{API_KEY}}");
IRealtimeChannel channel = realtime.Channels.Get("{{RANDOM_CHANNEL_NAME}}");
var message = new Message { Name = "example", Data = "payload", Id = "unique123" };
channel.Publish(message);
```

```realtime_swift
Expand Down Expand Up @@ -1103,9 +1104,10 @@ message.id = "unique123";
```

```rest_csharp
ARTRealtime *rest = [[ARTRealtime alloc] initWithKey:@"{{API_KEY}}"];
ARTRealtimeChannel *channel = [rest.channels get:@"{{RANDOM_CHANNEL_NAME}}"];
channel publish:@"example" data:@"payload" id:@"unique123" callback:^(ARTErrorInfo *error)
AblyRest rest = new AblyRest("{{API_KEY}}");
IRestChannel channel = rest.Channels.Get("{{RANDOM_CHANNEL_NAME}}");
var message = new Message { Name = "example", Data = "payload", Id = "unique123" };
await channel.PublishAsync(message);
```

```rest_swift
Expand Down
2 changes: 1 addition & 1 deletion src/pages/docs/storage-history/history.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ console.log('Last message before attach: ' + lastMessage.data);
Console.WriteLine("Received message: " + message.Data);
});

await channel.WaitForAttachAsync();
await channel.AttachAsync();

PaginatedResult<Message> resultPage = await channel.HistoryAsync(untilAttach: true);
Message lastMessage = resultPage.Items[0];
Expand Down