コード例 #1
0
        async Task <List <Notification> > GetNotificationList()
        {
            List <Notification> result = null;

            if (AppUtils.IsNetwork())
            {
                var request = new NotificationRequest
                {
                    PageNo = 1
                };
                _objProgress = new CustomProgress(this);
                var Authkey = StorageUtils <String> .GetPreferencesValue(DroidConstant.CurrentUser);

                var response = await _INotificationService.GetEventList(request, ServiceType.NotificationService, Authkey);

                _objProgress.DismissDialog();
                if (response != null)
                {
                    if (response.IsSuccess && response.Result != null)
                    {
                        result = response.Result;

                        if (result.Count == 0 && request.PageNo == 1)
                        {
                            AppUtils.ShowToast(this, response.Message);
                        }
                        else
                        {
                            notificatonAdatper.UpdateList(result);
                        }
                    }

                    else
                    {
                        AppUtils.ShowToast(this, response.Message);
                    }
                }
                else
                {
                    AppUtils.ShowToast(this, response.Message);
                }
            }
            else
            {
                AppUtils.ShowToast(this, Resources.GetString(Resource.String.network_error));
                _objProgress.DismissDialog();
            }
            return(result);
        }
コード例 #2
0
        public async void OnConnected(Bundle connectionHint)
        {
            //  Log.Debug(TAG, "onConnected:" + connectionHint);
            // GetName();
            //UpdateUI(true);

            if (PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient) != null)
            {
                var person = PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient);

                _objProgress = new CustomProgress(this);
                String auth = await GetAuthKey();
                await UserSocialLogin(auth, person.Name.ToString(), person.Name.ToString(), person.Id, (int)LoginTypes.Google);
            }
        }
コード例 #3
0
        /// <summary>
        /// Fetch Event
        /// </summary>
        /// <returns>List</returns>
        async Task <EventDetail> GetEventDetail()
        {
            EventDetail result = null;

            if (AppUtils.IsNetwork())
            {
                var request = new EventDetailRequest
                {
                    EventId = eventId
                };
                _objProgress = new CustomProgress(this);
                var Authkey = StorageUtils <String> .GetPreferencesValue(DroidConstant.CurrentUser);

                var response = await _IEventListService.GetEventDetail(request, ServiceType.EventService, Authkey);

                _objProgress.DismissDialog();
                if (response != null)
                {
                    if (response.IsSuccess && response.Result != null)
                    {
                        result = response.Result;
                    }
                    else
                    {
                        AppUtils.ShowToast(this, response.Message);
                    }
                }
                else
                {
                    AppUtils.ShowToast(this, Resources.GetString(Resource.String.network_error));
                }
            }
            else
            {
                AppUtils.ShowToast(this, Resources.GetString(Resource.String.network_error));
                _objProgress.DismissDialog();
            }

            return(result);
        }
コード例 #4
0
        void SetClickListener()
        {
            txtvwLogin.Click += async delegate
            {
                if (validateInputs())
                {
                    _objProgress = new CustomProgress(this);
                    String auth = await GetAuthKey();
                    await UserLogin(auth);
                }
            };


            txtvwFacebookLogin.Click += delegate {
                button.PerformClick();
            };
            txtvwGoogleLogin.Click += delegate
            {
                mShouldResolve = true;
                mGoogleApiClient.Connect();
            };
        }
コード例 #5
0
        async void mProfileTracker_mOnProfileChanged(object sender, OnProfileChangedEventArgs e)
        {
            if (e.mProfile != null)
            {
                try
                {
                    _objProgress = new CustomProgress(this);
                    String auth = await GetAuthKey();
                    await UserSocialLogin(auth, e.mProfile.Name.ToString(), e.mProfile.Name.ToString(), e.mProfile.Id, (int)LoginTypes.Facebook);

                    //  mTxtLastName.Text = e.mProfile.LastName;
                }

                catch (Exception ex)
                {
                    Toast.MakeText(this, ex.ToString(), ToastLength.Short);
                }
            }

            else
            {
                //the user must have logged out
            }
        }