peerwaya / flutter_account_kit

A Flutter plugin that wraps the Facebook Account Kit SDK
BSD 2-Clause "Simplified" License
44 stars 17 forks source link

Optional SMS feature #35

Open GabrielKiesshau opened 5 years ago

GabrielKiesshau commented 5 years ago

Hi, could we have an option to disable the SMS button in the Account Kit UI?

FlutterAccountKitPlugin.java:

if (this.options.containsKey("enableSMS")) {
    boolean enableSMS = (Boolean) this.options.get("enableSMS");
    configurationBuilder.setEnableSms(enableSMS);
}

config.dart:

  /// Enables the SMS button in the Account Kit UI.
  ///
  bool enableSMS;
...
  Map<String, dynamic> map = <String, dynamic>{
      'initialAuthState': initialAuthState,
      'facebookNotificationsEnabled': facebookNotificationsEnabled,
      'readPhoneStateEnabled': readPhoneStateEnabled,
      'enableSMS': enableSMS,
      'receiveSMS': receiveSMS,
      'defaultCountry': defaultCountry,
      'responseType': _responseTypeAsString(),
      'titleType': _titleTypeAsString(),
      'initialEmail': initialEmail,
      'initialPhoneCountryPrefix': initialPhoneNumber != null ? initialPhoneNumber.countryCode : null,
      'initialPhoneNumber': initialPhoneNumber != null ? initialPhoneNumber.number : null,
    };
 ...
peerwaya commented 4 years ago

You can add it, should be simple