Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     Console.Title = "Real-time chat";
     InitializerAPI.InitializeAPI();
     RTMessageServiceConnector.ConnectRT();
     ChatActivity.StartChat();
 }
Ejemplo n.º 2
0
        static void Main(String[] args)
        {
            try
            {
                InitializerAPI.InitAPI();
                IEventHandler <Person> eventHandler = Backendless.Data.Of <Person>().RT();

                eventHandler.AddCreateListener(createdObject =>
                {
                    Console.WriteLine($"Person object has been created. Object Id - { createdObject.ObjectId }");
                });

                Backendless.RT.AddConnectErrorListener((fault) =>
                {
                    Console.WriteLine($"Connection error. {fault}");
                });

                Backendless.RT.AddConnectListener(() =>
                {
                    Backendless.Data.Of <Person>().Save(new Person("Joe", 21));
                });
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred during the operation" + e);
            }

            Console.ReadKey();
        }
Ejemplo n.º 3
0
        public MainPage()
        {
            InitializerAPI.InitializeAPI();
            InitializeComponent();
            try
            {
                IChannel channel = Backendless.Messaging.Subscribe("chat");
                MessageReceived <String> messageListener = async(message) =>
                {
                    await Device.InvokeOnMainThreadAsync(() =>
                    {
                        View label = new Label
                        {
                            TextColor = Color.Green,
                            Text      = message
                        };
                        stackLayout.Children.Add(label);
                        scroll.Content = stackLayout;
                    });
                };

                channel.AddMessageListener(messageListener);
            }
            catch (Exception e)
            {
                DisplayAlert("Error", e.Message, "Ok");
            }
        }
Ejemplo n.º 4
0
 public MainPage()
 {
     InitializerAPI.InitializeAPI();
     InitializeComponent();
     try
     {
     }
     catch (Exception e)
     {
         DisplayAlert("Error", e.Message, "Ok");
     }
 }
Ejemplo n.º 5
0
 public MainPage()
 {
     InitializerAPI.InitializeAPI();
     InitializeComponent();
     try
     {
         if (Backendless.UserService.LoggedInUserObjectId() != null)
         {
             Navigation.PushModalAsync(new LogInPage(Backendless.Data.Of <BackendlessUser>()
                                                     .FindById(Backendless.UserService.LoggedInUserObjectId())));
         }
     }
     catch (Exception e)
     {
         Device.InvokeOnMainThreadAsync(() =>
         {
             DisplayAlert("Error", e.Message, "Ok");
         });
     }
 }
Ejemplo n.º 6
0
 static void Main(string[] args)
 {
     InitializerAPI.InitializeAPI();
 }
Ejemplo n.º 7
0
 public MainPage()
 {
     InitializerAPI.InitializeAPI();
     InitializeComponent();
 }