flutter_incoming_call
a flutter plugin to show incoming call in your flutter app! alpha version(not ready for production!)
usage
to use this plugin:
- configure android project:
just add to your manifest activity and receiver.
<activity
android:name="com.github.alezhka.flutter_incoming_call.incomingcallactivity"
android:theme="@style/theme.appcompat"
android:screenorientation="portrait"
android:showonlockscreen="true">
<intent-filter>
<action android:name="com.github.alezhka.flutter_incoming_call.activity.action_incoming_call" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>
<receiver android:name="com.github.alezhka.flutter_incoming_call.callbroadcastreceiver"
android:enabled="true"
android:exported="false"/>
- configure flutter plugin:
flutterincomingcall.configure(
appname: 'example_incoming_call',
duration: 30000,
android: configandroid(
vibration: true,
ringtonepath: 'default',
channelid: 'calls',
channelname: 'calls channel name',
channeldescription: 'calls channel description',
),
ios: configios(
iconname: 'appicon40x40',
ringtonepath: null,
includescallsinrecents: false,
supportsvideo: true,
maximumcallgroups: 2,
maximumcallspercallgroup: 1,
)
)
- listen events:
flutterincomingcall.onevent.listen((event) {
if(event is callevent) { // android | ios
} else if(event is holdevent) { // ios
} else if(event is muteevent) { // ios
} else if(event is dmtfevent) { // ios
} else if(event is audiosessionevent) { // ios
}
});
- call api:
flutterincomingcall.displayincomingcall(string uid, string name, string avatar, string handle, string type, bool isvideo);
flutterincomingcall.endcall(string uuid);
flutterincomingcall.endallcalls();
demo
ios | ios (lockscreen) | android | android (lockscreen) |
---|---|---|---|
example
check out the example in the example project folder for a working example.
Comments are closed.