Exemplo n.º 1
0
        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;
                }
            }
        }
Exemplo n.º 2
0
        public override void Init(object initData)
        {
            base.Init(initData);
            Items = new List <Trade>();
            _api  = new MyntApi();

            Task.Factory.StartNew(x => RefreshData(false), null);
        }
Exemplo n.º 3
0
        public override void Init(object initData)
        {
            base.Init(initData);
            FunctionRoot = Settings.FunctionRoot;

            _api = new MyntApi();

            Task.Factory.StartNew(x => RefreshData(), null);
        }
Exemplo n.º 4
0
        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;
            }
        }