static void Main(string[] args) { Console.Title = "Real-time chat"; InitializerAPI.InitializeAPI(); RTMessageServiceConnector.ConnectRT(); ChatActivity.StartChat(); }
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(); }
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"); } }
public MainPage() { InitializerAPI.InitializeAPI(); InitializeComponent(); try { } catch (Exception e) { DisplayAlert("Error", e.Message, "Ok"); } }
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"); }); } }
static void Main(string[] args) { InitializerAPI.InitializeAPI(); }
public MainPage() { InitializerAPI.InitializeAPI(); InitializeComponent(); }