Search packages, repositories and app categories

Package detailsv3.0.14

get_phone_number

Get real phone number from device - It only works on android device and also need to run in a real device.

Android
30-day downloads
1.1K
Likes
41
Pub points
160

Install package

flutter pub add get_phone_number

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The get_phone_number package allows Flutter applications to retrieve the device's actual phone number on Android. It is designed specifically for Android and requires execution on a physical device, as it relies on native Android system permissions and APIs. The package does not support iOS. It is useful for apps that need to identify or verify the user’s phone number directly from the device. Access to the phone number requires appropriate runtime permissions and may vary depending on device manufacturers and Android versions.

Use cases

  • Fetching device phone number in Android apps
  • User authentication using phone number
  • Device identification in mobile apps
  • Enabling SMS-based verification flows
  • Integrating with telecommunication services

Key features

  • Android-only compatibility
  • Requires physical device for operation
  • Uses native Android APIs
  • Supports runtime permission handling
  • Simple integration via Flutter pub

Suitable for

  • Android app developers needing phone number access
  • Apps requiring direct device phone number retrieval
  • Projects involving SMS or call functionality
  • Developers working with device-level hardware features
  • Applications focused on user identity verification

Considerations

  • Only works on Android devices
  • Must run on a real physical device
  • Requires user permission at runtime
  • May not work on all Android devices due to manufacturer restrictions
  • Limited to Android platform only

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

get_phone_number

Get Phone Number from Android Native

Warning: This library works in only android.

Usage

Simple function
    String phoneNumber = await GetPhoneNumber().get();

    print('getPhoneNumber result: $phoneNumber');
List of phone number
    List<String> list = await GetPhoneNumber().getListPhoneNumber();

    print('getListPhoneNumber result: list');
Detailed function with android permissions
    final module = GetPhoneNumber();

    if (!module.isSupport()) {
        print('Not supported platform');
    }

    if (!await module.hasPermission()) {
      if (!await module.requestPermission()) {
        throw 'Failed to get permission phone number';
      }
    }

    String phoneNumber = await module.getPhoneNumber();
    print('getPhoneNumber result: $phoneNumber');

Buy Me A Coffee

Categories

Source repository

Projects using this package

No data available yet.