Beispiel #1
0
        protected async override void OnAppearing()
        {
            FacebookUser _facebookUser = new FacebookUser();
            User         _user         = new User();

            if (!String.IsNullOrEmpty(token))
            {
                _facebookUser = await _social.GetFacebookProfileAsync(token);

                var gps = new GetGPS();
                var loc = await gps.updateLocation();

                //List<CouponSchedule> googledCoupons = await google.GoogleNearby(loc);
                _user = _azure.GetUser(_facebookUser.Id, "fbId");

                //_user = _azure.GetUserInfo(_facebookUser.Id);
                await Navigation.PushModalAsync(new MainPage(_user));

                //else if(token == null)
                //    await Navigation.PushModalAsync(new MainPage(App.Token));
                //Debug.WriteLine("token in app is =" + App.Token);
                //Debug.WriteLine("back!!");
                //token = App.Token;
            }
        }
Beispiel #2
0
 private void Awake()
 {
     if (getGPS == null)
     {
         getGPS = this;
     }
 }
Beispiel #3
0
        private async void refreshInfo()
        {
            absLayout.ItemsSource = null;
            masterCoupons         = new List <CouponSchedule>();
            GetGPS   _gps       = new GetGPS();
            Location myLocation = await _gps.updateLocation();

            if (myLocation == null)
            {
                myLocation.lat = 43.217703;
                myLocation.lng = -79.861937;
            }

            masterCoupons = await _google.GoogleNearby(myLocation);

            //masterCoupons = filterCoupons(masterCoupons);
            couponList.couponList = masterCoupons;
            int i = 0;

            masterCoupons = _google.GoogleImages(masterCoupons);
            foreach (var n in masterCoupons)
            {
                n.OnFindCoupon += new CouponSchedule.FindCouponHandler(FindThisPlace);
                Console.WriteLine("TypeLink  ====>  " + n.thisCoupon.TypeLink);
                if (n.thisCoupon.ImageStream != null)
                {
                    fixedCoupons.Add(n);
                }

                i++;
            }

            absLayout.ItemsSource = fixedCoupons;
            BindingContext        = fixedCoupons;
        }
Beispiel #4
0
 private void Update()
 {
     Instance = this;
     StartCoroutine(UpdateLocation());
 }
Beispiel #5
0
 private void Start()
 {
     Instance = this;
     DontDestroyOnLoad(gameObject);
     StartCoroutine(StartLocationService());
 }