private async Task RegisterForPush(string deviceToken) { // Update registration var api = new MyntApi(); // Set to false before trying. Settings.IsDeviceRemoteRegistered = false; // Only available when connected. if (CrossConnectivity.Current.IsConnected) { var installation = new Installation() { InstallationId = Settings.CurrentUniqueId, Platform = "apns", PushChannel = deviceToken }; // Create our own push registration record. var id = await api.Register(installation); // If these match the registration was successful if (id != null) { // Succesfully registered! Settings.IsDeviceRemoteRegistered = true; // Set the new device token. Settings.DeviceToken = deviceToken; } } }
public override void Init(object initData) { base.Init(initData); Items = new List <Trade>(); _api = new MyntApi(); Task.Factory.StartNew(x => RefreshData(false), null); }
public override void Init(object initData) { base.Init(initData); FunctionRoot = Settings.FunctionRoot; _api = new MyntApi(); Task.Factory.StartNew(x => RefreshData(), null); }
public async override void Init(object initData) { base.Init(initData); _api = new MyntApi(); _euroApi = new EuroApi(); Task.Factory.StartNew(x => GetEuroPrice(), null); if (initData is Trade) { var trade = initData as Trade; Uuid = trade.Uuid; Currency = trade.Currency; Quantity = trade.Quantity; CurrentRate = trade.CurrentRate; CurrentProfitPercentage = trade.CurrentProfitPercentage; CurrentProfit = Quantity * trade.CurrentProfit; HasCurrentProfit = trade.HasCurrentProfit; } }