greensms 0.1.1 copy "greensms: ^0.1.1" to clipboard
greensms: ^0.1.1 copied to clipboard

Flutter SDK for GreenSMS call verification: send, receive, status API and ready-made UI widgets for phone auth by call.

greensms #

pub package

Flutter SDK для верификации по звонку через GreenSMS API.

Возможности #

  • Call Send — исходящий звонок, код в последних цифрах номера звонящего
  • Call Receive — пользователь звонит на выданный номер
  • Call Status — проверка статуса верификации
  • UI-виджеты — готовый экран CallVerificationScreen

Установка #

dependencies:
  greensms: ^0.1.1
flutter pub get

Быстрый старт (HTTP-клиент) #

import 'package:greensms/greensms.dart';

final client = GreenSmsClient(token: 'YOUR_TOKEN');
// или: GreenSmsClient(user: 'user', pass: 'pass');

final send = await client.call.send(
  CallSendRequest(to: '79001234567', language: 'ru'),
);
print(send.requestId);
print(send.code);

final receive = await client.call.receive(
  CallReceiveRequest(to: '79001234567'),
);
print(receive.number);

final status = await client.call.status(
  CallStatusRequest(id: send.requestId, extended: true),
);
print(status.statusCode);

client.close();

UI-виджет #

Send-режим: пользователь вводит номер → получает звонок → вводит последние цифры номера звонящего → SDK сравнивает с кодом из API.

Receive-режим: пользователь вводит номер → звонит на выданный номер → SDK проверяет статус через polling.

CallVerificationScreen(
  client: client,
  mode: CallVerificationMode.send,
  onVerified: (requestId) => print('OK: $requestId'),
  onError: (e) => print(e),
)

Безопасность #

Не храните user и pass в мобильном приложении. Используйте Bearer token с ограниченными правами или проксируйте запросы через свой backend.

Example #

cd example
flutter pub get
flutter run --dart-define=GREENSMS_TOKEN=your_token

Документация API #

Лицензия #

MIT — см. LICENSE.

0
likes
155
points
24
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter SDK for GreenSMS call verification: send, receive, status API and ready-made UI widgets for phone auth by call.

Repository (GitHub)
View/report issues

Topics

#sms #authentication #verification #api #phone

License

MIT (license)

Dependencies

flutter, http, url_launcher

More

Packages that depend on greensms