partial void BtnSend_TouchUpInside(UIButton sender)
 {
     if (txtmsg.Text == "")
     {
         return;
     }
     ChatOn.objMyChat().SendMessage((int)NSUserDefaults.StandardUserDefaults.IntForKey("Chat_Receiver_QuickBoxID"), txtmsg.Text);
     SaveSendData();
     loadmsg("S");
 }
 void resultSaveCompletion(ObservableCollection <VerifyOTP> wDatas)
 {
     if (wDatas[0].Result == "True")
     {
         ChatOn.objMyChat().SendMessage((int)NSUserDefaults.StandardUserDefaults.IntForKey("Chat_Receiver_QuickBoxID"), "Send");
         Console.Write("Saved");
     }
     else
     {
         Console.Write("Not Saved");
     }
 }
示例#3
0
        //public static class ApplicationKeys
        //{
        //    //public const int ApplicationId = 52677;
        //    //public const string AuthorizationKey = "4dWHHgGWXYz8FZq";
        //    //public const string AuthorizationSecret = "BTFsj7Rtt27DAmT";
        //    //public const string ApiBaseEndpoint = "http://api.quickblox.com";
        //    //public const string ChatEndpoint = "chat.quickblox.com";
        //    //public const string ChatMucEndpoint = "muc." + ChatEndpoint;

        //    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;

        //}


        public static ChatOn objMyChat()
        {
            if (_objChat == null)
            {
                _objChat = new ChatOn();
            }


            //InitializeQBoxClient();

            return(_objChat);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            chatinit();
            //subb();
            //return;


            int    myUserID   = (int)NSUserDefaults.StandardUserDefaults.IntForKey("Chat_Sender_QuickBoxID");
            String myPassword = NSUserDefaults.StandardUserDefaults.StringForKey("Chat_Sender_QuickBoxID_Password").ToString();


            ChatOn.objMyChat().initilizeDeligateIncoming(onMessageReceiveStatus, onErrorMessage);
            ChatOn.objMyChat().initilizeDemondDeligateIncoming(onMessageReceiveDemondStatus);
            ChatOn.objMyChat().LoginUser(myUserID, myPassword);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            chatinit();
            //string ss = CommonData.mCompanyName;
            SetUpTableView();
            SetUpToolbar();

            SendButton.TouchUpInside += OnSendClicked;

            TextView.Started += OnTextViewStarted;
            TextView.Changed += OnTextChanged;

            int    myUserID   = (int)NSUserDefaults.StandardUserDefaults.IntForKey("Chat_Sender_QuickBoxID");
            String myPassword = NSUserDefaults.StandardUserDefaults.StringForKey("Chat_Sender_QuickBoxID_Password").ToString();

            ChatOn.objMyChat().initilizeDeligateIncoming(onMessageReceiveStatus, onErrorMessage);
            ChatOn.objMyChat().initilizeDemondDeligateIncoming(onMessageReceiveDemondStatus);
            ChatOn.objMyChat().initilizeDemondDeligateIncoming_ChatImage(onMessageReceiveDemondStatus_ChatImage);

            ChatOn.objMyChat().LoginUser(myUserID, myPassword);

            //this.NavigationItem.Title=NSUserDefaults.StandardUserDefaults.StringForKey("Chat_Receiver").ToString();
            this.Title = NSUserDefaults.StandardUserDefaults.StringForKey("Chat_Receiver").ToString();
            this.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem("Back"
                                                                         , UIBarButtonItemStyle.Plain, (sender, args) =>
            {
                NavigationController.PopViewController(true);
            }), true);

            this.NavigationItem.SetRightBarButtonItem(
                new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, args) =>
            {
                NSObject CallSender = new NSObject();
                this.PerformSegue("CallDemand", CallSender);
            })
                , true);
        }
示例#6
0
        void resultSendCompletion(ObservableCollection <ChatRequest> wDatas)
        {
            if (wDatas == null)
            {
                return;
            }

            if (wDatas[0].Result == "True")
            {
                ChatOn.objMyChat().SendMessage(Convert.ToInt32(lblQuickBoxID.Text), "ChatRequest");
                txtCompanyName.Text      = "";
                txtContactName.Text      = "";
                txtEmailID.Text          = "";
                txtPhone.Text            = "";
                txtType.Text             = "";
                lblJewelXchangeID.Text   = "";
                lblQuickBoxID.Text       = string.Empty;
                txtJewelsExchangeID.Text = string.Empty;
                pnlChatRequest.Hidden    = true;

                //ChatOn.objMyChat().ChatDemondNotification("Demond :\n");
            }
        }
 private async void chatinit()
 {
     await ChatOn.objMyChat().InitializeQBoxClient();
 }
        //partial void BtnUser_TouchUpInside(UIButton sender)
        //{
        //	subb();
        //}

        private async void subb()
        {
            await ChatOn.objMyChat().CreateNewUser("*****@*****.**", "Kannan1Ashogan", "Kannan@1234");

            string ss = ChatOn.objMyChat().sUserID;
        }
示例#9
0
        void Initialize()
        {
            BubbleImageView = new UIImageView {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            MessageLabel = new UILabel {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Lines = 0,
                PreferredMaxLayoutWidth = 220f
            };
            AudioPlayButton = new UIButton
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Hidden = true
            };
            ImageAttachment = new UIButton
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Hidden = true,
            };

            //ImageAttachment = UIButton.FromType(UIButtonType.Custom);
            //ImageAttachment.Frame.Width  = new RectangleF(100, 100, 60, 50);
            ImageAttachment.TouchUpInside += delegate
            {
                string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                //sAudioFileName = msg.AudioFileName;
                string localPath = Path.Combine(documentsPath, msg.ImgFileName);
                if (File.Exists(localPath) == true)
                {
                    ChatOn.objMyChat().ChatImageNotification(msg.ImgFileName);

                    //NSObject sender = new NSObject();
                    //ViewController_Test controller = .Storyboard.InstantiateViewController("ViewController_Test") as ViewController_Test;
                    //UINavigationController nav =new UINavigationController();
                    //nav.PushViewController(ViewControlle, true);

                    //ViewController_Test controller = objChat.Storyboard.InstantiateViewController("ViewController_Test") as ViewController_Test;
                    //objChat.NavigationController.PushViewController(controller, true);


                    //var storyboard = UIStoryboard.FromName("Main", null);
                    //ViewController_Test controller = storyboard.InstantiateViewController("ViewController_Test") as ViewController_Test;
                    //UINavigationController nav = new UINavigationController();
                    //nav.PushViewController(controller, true);

                    //nav.PerformSegue("ShowImage", sender);
                    //	ImageAttachment.SetBackgroundImage(UIImage.FromFile("Attach1.png"), UIControlState.Normal);
                    //}
                    //else
                    //{
                    //	LoadDownloadImageFile(msg.ImgFileName);
                }
            };


            AudioPlayButton.TouchUpInside += delegate
            {
                string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
                //sAudioFileName = msg.AudioFileName;
                string localPath = Path.Combine(documentsPath, msg.AudioFileName);
                if (File.Exists(localPath) == true)
                {
                    try
                    {
                        if (player == null)
                        {
                            AudioPlayButton.SetBackgroundImage(UIImage.FromFile("Final Image/StopSmall.png"), UIControlState.Normal);
                            LoadAudioPlay(localPath);
                        }
                        else
                        {
                            if (player.Playing == true)
                            {
                                AudioPlayButton.SetBackgroundImage(UIImage.FromFile("Final Image/PlaySmall.png"), UIControlState.Normal);
                                player.Stop();
                                player = null;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Console.Out.WriteLine(ex.StackTrace);
                    }
                }
                else
                {
                    LoadDownloadAudioFile(msg.AudioFileName);
                }
                //AudioStopButton.Hidden = false;
                //new UIAlertView("Touch1", "TouchUpInside handled", null, "OK", null).Show();
            };


            //AudioStopButton.TouchUpInside += delegate
            //{
            //	//new UIAlertView("Touch1", "TouchUpInside handled", null, "OK", null).Show();
            //	AudioStopButton.Hidden = true;
            //};
            //AudioDownloadButton.TouchUpInside += delegate
            //{
            //	new UIAlertView("Download", "TouchUpInside handled", null, "OK", null).Show();
            //};

            //AudioPlayButton = new UIButton
            //{
            //	TranslatesAutoresizingMaskIntoConstraints = false,
            //	Frame = new CoreGraphics.CGRect(160, 30, 30, 30),


            //};


            AudioPlayButton.SetBackgroundImage(UIImage.FromFile("Final Image/PlaySmall.png"), UIControlState.Normal);
            //AudioStopButton.SetBackgroundImage(UIImage.FromFile("Final Image/StopSmall.png"), UIControlState.Normal);
            //AudioDownloadButton.SetBackgroundImage(UIImage.FromFile("Final Image/DownloadSmall.png"), UIControlState.Normal);

            ContentView.AddSubviews(BubbleImageView, MessageLabel, AudioPlayButton, ImageAttachment);           //,AudioStopButton,AudioDownloadButton
        }