Skip to content

System.AggregateException has been thrown while trying to connect to a private channel #85

@15mgm15

Description

@15mgm15

Hello! I have this exception while trying to connect to a private channel. I am using PusherClient 1.1.0 on Xamarin.Forms and I am testing with an iPhone simulator and a real device.

_pusherClient = new Pusher(ApplicationSettings.PusherId, new PusherOptions
{
    Authorizer = new HttpAuthorizer("our url"),
});

_pusherClient.ConnectionStateChanged += PusherConnectionChanged;
_pusherClient.Error += PusherError;

// _subscription = our private channel
var channel = await _pusherClient.SubscribeAsync(_subscription);
channel.Subscribed += ChannelSubscribed;

channel.Bind("userUpdated", (dynamic data) =>
{
    Console.WriteLine(data);
});

await _pusherClient.ConnectAsync();

This is the exception:
Screen Shot 2019-11-13 at 10 14 44

This is the inner exception:

{Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 0, position 0.
  at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () [0x00000] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x0004a] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeAnonymousType[T] (System.String value, T anonymousTypeObject) [0x00000] in <12891e825fce44a581e5bbbb579c1d49>:0 
  at PusherClient.Pusher.SubscribeToChannel (System.String channelName) [0x0008e] in <3948be5ee8fa4f22bfbd47bfe37b2beb>:0 }

If I connect to a public channel everything works correctly, do you guys have any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions