Exemplo n.º 1
0
        // Fela: DEPRECATED
        //public void SendCallAsync(string phoneNumber, string phoneCodeHash, Action<bool> callback, Action<TLRPCError> faultCallback = null)
        //{
        //    var obj = new TLSendCall { PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash };

        //    SendInformativeMessage("auth.sendCall", obj, callback, faultCallback);
        //}

        public void SignUpAsync(string phoneNumber, string phoneCodeHash, string phoneCode, string firstName, string lastName, Action <TLAuthAuthorization> callback, Action <TLRPCError> faultCallback = null)
        {
            var obj = new TLAuthSignUp {
                PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash, PhoneCode = phoneCode, FirstName = firstName, LastName = lastName
            };

            SendInformativeMessage <TLAuthAuthorization>("auth.signUp", obj,
                                                         auth =>
            {
                _cacheService.SyncUser(auth.User, result => { });
                callback(auth);
            },
                                                         faultCallback);
        }
Exemplo n.º 2
0
        // Fela: DEPRECATED
        //public void SendCallAsync(string phoneNumber, string phoneCodeHash, Action<bool> callback, Action<TLRPCError> faultCallback = null)
        //{
        //    var obj = new TLSendCall { PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash };

        //    const string caption = "auth.sendCall";
        //    SendInformativeMessage(caption, obj, callback, faultCallback);
        //}

        public void SignUpAsync(string phoneNumber, string phoneCodeHash, string phoneCode, string firstName, string lastName, Action <TLAuthAuthorization> callback, Action <TLRPCError> faultCallback = null)
        {
            var obj = new TLAuthSignUp {
                PhoneNumber = phoneNumber, PhoneCodeHash = phoneCodeHash, PhoneCode = phoneCode, FirstName = firstName, LastName = lastName
            };

            const string caption = "auth.signUp";

            SendInformativeMessage <TLAuthAuthorization>(caption, obj,
                                                         auth =>
            {
                _cacheService.SyncUser(auth.User, result => { });
                callback(auth);
            },
                                                         faultCallback, flags: RequestFlag.FailOnServerError | RequestFlag.WithoutLogin);
        }