-
- 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
Note: these modifications are handled automatically by Client plugin if it is used.android.permission.CALL_PHONE
needs to be added.<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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
call(java.lang.String number)
Starts a phone call to the given number with the native dial application.static java.util.Optional<DialerService>
create()
Returns an instance ofDialerService
.
-
-
-
Method Detail
-
create
static java.util.Optional<DialerService> create()
Returns an instance ofDialerService
.- Returns:
- An instance of
DialerService
.
-
call
void call(java.lang.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.
-
-