Interface DialerService

All Known Implementing Classes:
AndroidDialerService, DummyDialerService, IOSDialerService

public interface DialerService
Using the dialer service, you can initiate a call to the provided phone number. The implementation will use the device's default dial application to make the phone call.

Example

 DialerService.create().ifPresent(service -> {
      service.call("+32987123456");
  });

Android Configuration

The permission android.permission.CALL_PHONE needs to be added.

Note: these modifications are handled automatically by GluonFX plugin if it is used.
 <manifest ...>
    <uses-permission android:name="android.permission.CALL_PHONE"/>
    ...
   <activity android:name="com.gluonhq.impl.attach.plugins.android.PermissionRequestActivity" />
  </manifest>

iOS Configuration: none

Since:
3.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    call(String number)
    Starts a phone call to the given number with the native dial application.
    Returns an instance of DialerService.
  • Method Details

    • create

      static Optional<DialerService> create()
      Returns an instance of DialerService.
      Returns:
      An instance of DialerService.
    • call

      void call(String number)
      Starts a phone call to the given number with the native dial application.
      Parameters:
      number - A valid telephone number, without spaces, optionally including an international prefix.