Ejemplo n.º 1
0
 public GroupChatManager(QuickbloxClient quickbloxClient, string groupJid, string dialogId)
 {
     this.quickbloxClient = quickbloxClient;
     this.groupJid        = groupJid;
     this.dialogId        = dialogId;
     quickbloxClient.ChatXmppClient.MessageReceived += MessagesClientOnOnMessageReceived;
 }
Ejemplo n.º 2
0
        public async Task TestInitialize()
        {
            this.client = new QuickbloxClient((int)GlobalConstant.ApplicationId, GlobalConstant.AuthorizationKey, GlobalConstant.AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint, new HmacSha1CryptographicProvider());
            var sessionResponse = await this.client.AuthenticationClient.CreateSessionBaseAsync();

            client.Token = sessionResponse.Result.Session.Token;
        }
Ejemplo n.º 3
0
        public async Task RetrieveUsersUnauthorizedTest()
        {
            QuickbloxClient client2  = new QuickbloxClient((int)ApplicationId, AuthorizationKey, AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint);
            var             response = await client2.UsersClient.RetrieveUsersAsync();

            Assert.IsTrue(response.StatusCode == HttpStatusCode.Unauthorized);
        }
Ejemplo n.º 4
0
        public async Task TestInitialize()
        {
            this.client = new QuickbloxClient((int)ApplicationId, AuthorizationKey, AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint, logger: new DebugLogger());
            var sessionResponse = await this.client.AuthenticationClient.CreateSessionBaseAsync();

            client.Token = sessionResponse.Result.Session.Token;
        }
Ejemplo n.º 5
0
        public async Task TestInitialize()
        {
            this.client = new QuickbloxClient((int)GlobalConstant.ApplicationId, GlobalConstant.AuthorizationKey, GlobalConstant.AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint, logger: new FileLogger());
            var sessionResponse = await this.client.AuthenticationClient.CreateSessionWithEmailAsync("*****@*****.**", "12345678");

            client.Token = sessionResponse.Result.Session.Token;
        }
Ejemplo n.º 6
0
        public async Task TestInitialize()
        {
            this.client = new QuickbloxClient(ApplicationId, AuthorizationKey, AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint);
            var sessionResponse = await this.client.AuthenticationClient.CreateSessionWithLoginAsync(Login, Password);

            client.Token = sessionResponse.Result.Session.Token;
        }
        public CallHelperProvider(QuickbloxClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            chatXmppClient = client.ChatXmppClient;
            webSyncClient  = client.WebSyncClient;

            chatXmppClient.MessageReceived += OnMessageReceived;
            webSyncClient.VideoChatMessage += OnVideoChatMessageReceived;
#if WINDOWS_APP
            callOutgoingAudioTimer          = new DispatcherTimer();
            callOutgoingAudioTimer.Tick    += OnCallOutgoingAudioTimer;
            callOutgoingAudioTimer.Interval = TimeSpan.FromMilliseconds(5000);

            callIncomingAudioTimer          = new DispatcherTimer();
            callIncomingAudioTimer.Tick    += OnCallIncomingAudioTimer;
            callIncomingAudioTimer.Interval = TimeSpan.FromMilliseconds(5000);
#else
            callOutgoingAudioTimer          = new Timer();
            callOutgoingAudioTimer.Elapsed += OnCallOutgoingAudioTimer;
            callOutgoingAudioTimer.Interval = 5000;

            callIncomingAudioTimer          = new Timer();
            callIncomingAudioTimer.Elapsed += OnCallIncomingAudioTimer;
            callIncomingAudioTimer.Interval = 5000;
#endif
        }
Ejemplo n.º 8
0
 internal PrivateChatManager(QuickbloxClient quickbloxClient, int otherUserId, string dialogId)
 {
     this.otherUserId     = otherUserId;
     this.otherUserJid    = ChatXmppClient.BuildJid(otherUserId, quickbloxClient.ApplicationId, quickbloxClient.ChatEndpoint);
     this.dialogId        = dialogId;
     this.quickbloxClient = quickbloxClient;
     quickbloxClient.ChatXmppClient.MessageReceived += MessagesClientOnOnMessageReceived;
 }
Ejemplo n.º 9
0
        public static async Task ClassInitialize(TestContext testContext)
        {
            client1 = new QuickbloxClient((int)GlobalConstant.ApplicationId, GlobalConstant.AuthorizationKey, GlobalConstant.AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint);
            //await client1.InitializeClientAsync(GlobalConstant.ApiBaseEndPoint, GlobalConstant.AccountKey, new HmacSha1CryptographicProvider());
            //await client1.AuthenticationClient.CreateSessionWithEmailAsync(GlobalConstant.ApplicationId, GlobalConstant.AuthorizationKey, GlobalConstant.AuthorizationSecret, email1, password1);
#if DEBUG
            //client1.ChatXmppClient.DebugClientName = "1";
#endif
            await client1.ChatXmppClient.Connect(id1, password1);
        }
        public async Task TestInitialize()
        {
            this.client = new QuickbloxClient((int)GlobalConstant.ApplicationId, GlobalConstant.AuthorizationKey, GlobalConstant.AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint);
            var sessionResponse = await this.client.AuthenticationClient.CreateSessionWithLoginAsync("Test654321", "Test12345", deviceRequestRequest : new DeviceRequest()
            {
                Platform = Quickblox.Sdk.GeneralDataModel.Models.Platform.windows_phone, Udid = Helpers.GetHardwareId()
            });

            client.Token = sessionResponse.Result.Session.Token;
        }
Ejemplo n.º 11
0
        public async Task InitializeQBoxClient()
        {
            if (_quickbloxClient == null)
            {
                const int    applicationId   = 52677;
                const String authKey         = "Hp9zVxgqNg-hbwV";
                const String authSecret      = "ee4vhYTVf5SBpTB";
                const string ApiBaseEndpoint = "https://api.quickblox.com";
                const string ChatEndpoint    = "chat.quickblox.com";
                const string ChatMucEndpoint = "muc." + ChatEndpoint;

                _quickbloxClient = new QuickbloxClient(applicationId, authKey, authSecret,
                                                       ApiBaseEndpoint, ChatEndpoint);
                //if (reIntialize)
                //{
                try
                {
                    var sessionResponse = await _quickbloxClient.AuthenticationClient.CreateSessionBaseAsync();

                    Console.WriteLine(sessionResponse.StatusCode);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
                //    }
                //    else{
                //        var sessionResponse = _quickbloxClient.AuthenticationClient.CreateSessionBaseAsync();
                //        Console.WriteLine(sessionResponse);
                //}



                //return sessionResponse.StatusCode;
            }

            //return (System.Net.HttpStatusCode)_quickbloxClient.AuthenticationClient.GetSessionAsync().Status;
            //else if (quickbloxClient.)

            //return quickbloxClient;
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            var fileLogger = new FileLogger();
            var quickbloxClient = new QuickbloxClient(ApplicationKeys.ApplicationId, ApplicationKeys.AuthorizationKey, ApplicationKeys.AuthorizationSecret, ApplicationKeys.ApiBaseEndPoint, ApplicationKeys.ChatEndpoint, fileLogger);
            QmunicateLoggerHolder.LoggerInstance = fileLogger;
            var fileStorage = new FileStorage();

            ServiceLocator.Locator.Bind<INavigationService, NavigationService>(LifetimeMode.Singleton);
            ServiceLocator.Locator.Bind<IQuickbloxClient, QuickbloxClient>(quickbloxClient);
            ServiceLocator.Locator.Bind<IMessageService, MessageService>(LifetimeMode.Singleton);
            ServiceLocator.Locator.Bind<IDialogsManager, IDialogsManager>(new DialogsManager(quickbloxClient));
            ServiceLocator.Locator.Bind<IPushNotificationsManager, IPushNotificationsManager>(new PushNotificationsManager(quickbloxClient));
            ServiceLocator.Locator.Bind<IFileStorage, IFileStorage>(fileStorage);
            ServiceLocator.Locator.Bind<IImageService, IImageService>(new ImagesService(quickbloxClient, fileStorage));
            ServiceLocator.Locator.Bind<ICachingQuickbloxClient, ICachingQuickbloxClient>(new CachingQuickbloxClient(quickbloxClient));
            ServiceLocator.Locator.Bind<ICredentialsService, CredentialsService>(LifetimeMode.Singleton);

            UnhandledException += OnUnhandledException;

            this.InitializeComponent();
            this.Suspending += this.OnSuspending;
        }
Ejemplo n.º 13
0
        public static async Task ClassInitialize(TestContext testContext)
        {
            var logger = new Logger.DebugLogger();

            client1 = new QuickbloxClient((int)appId, authKey, authSecret, apiEndpoint, chatEndpoint, logger);
#if DEBUG
            client1.ChatXmppClient.DebugClientName = "1";
#endif
            await client1.ChatXmppClient.Connect(id1, password1);

            client2 = new QuickbloxClient((int)appId, authKey, authSecret, apiEndpoint, chatEndpoint, logger);
#if DEBUG
            client2.ChatXmppClient.DebugClientName = "2";
#endif
            await client2.ChatXmppClient.Connect(id2, password2);

            client3 = new QuickbloxClient((int)appId, authKey, authSecret, apiEndpoint, chatEndpoint, logger);
#if DEBUG
            client3.ChatXmppClient.DebugClientName = "3";
#endif
            await client3.ChatXmppClient.Connect(id3, password3);
        }
Ejemplo n.º 14
0
 internal ChatClient(QuickbloxClient quickbloxClient)
 {
     this.quickbloxClient = quickbloxClient;
 }
Ejemplo n.º 15
0
 public ContentClientHelper(QuickbloxClient quickbloxClient)
 {
     this.quickbloxClient = quickbloxClient;
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ContentClient"/> class.
 /// </summary>
 /// <param name="client">QuickbloxClient</param>
 internal ContentClient(QuickbloxClient client)
 {
     this.quickbloxClient = client;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomObjectsClient"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 internal CustomObjectsClient(QuickbloxClient client)
 {
     this.quickbloxClient = client;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationClient"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 internal NotificationClient(QuickbloxClient client)
 {
     this.quickbloxClient = client;
 }
Ejemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationClient"/> class.
 /// </summary>
 /// <param name="client">The client.</param>
 internal LocationClient(QuickbloxClient client)
 {
     this.quickbloxClient = client;
 }
		public void Init(QuickbloxClient client)
		{
			this.chatXmppClient = client.ChatXmppClient;
			this.webSyncClient = client.WebSyncClient;
		}
Ejemplo n.º 21
0
 public ChatXmppClient(QuickbloxClient quickbloxClient)
 {
     this.quickbloxClient = quickbloxClient;
     Contacts             = new List <RosterItem>();
     Presences            = new List <Jid>();
 }
 public void Init(QuickbloxClient client)
 {
     this.chatXmppClient = client.ChatXmppClient;
     this.webSyncClient  = client.WebSyncClient;
 }
 public async Task TestInitialize()
 {
     QuickbloxPlatform.Init();
     client = new QuickbloxClient((int)ApplicationId, AuthorizationKey, AuthorizationSecret, GlobalConstant.ApiBaseEndPoint, GlobalConstant.ChatEndpoint);
 }
Ejemplo n.º 24
0
 public WebSyncClient(QuickbloxClient client)
 {
     this.client = client;
     this.client.ChatXmppClient.MessageReceived += OnMessageReceived;
 }
Ejemplo n.º 25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UsersClient"/> class.
 /// </summary>
 /// <param name="quickbloxClient">The quickblox client.</param>
 internal UsersClient(QuickbloxClient quickbloxClient)
 {
     this.quickbloxClient = quickbloxClient;
 }
 internal AuthenticationClient(QuickbloxClient client, ICryptographicProvider cryptographicProvider)
 {
     this.quickbloxClient       = client;
     this.cryptographicProvider = cryptographicProvider;
 }