|
|
|
@ -76,32 +76,31 @@ void onStart(ServiceInstance service) async {
|
|
|
|
|
if (flag > 0) {
|
|
|
|
|
print("来电拒接/未接");
|
|
|
|
|
print("${phoneNum!}:${ref!}");
|
|
|
|
|
// Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref!);
|
|
|
|
|
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: ref!);
|
|
|
|
|
print("发送成功");
|
|
|
|
|
} else if(flag==-1){
|
|
|
|
|
print("来电接听");
|
|
|
|
|
print("${phoneNum!}:${con!}");
|
|
|
|
|
// Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con!);
|
|
|
|
|
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: con!);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if(entry.first.duration!>0){
|
|
|
|
|
if(callSw!){
|
|
|
|
|
print(callSw);
|
|
|
|
|
print("${phoneNum!}:${call!}");
|
|
|
|
|
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call!);
|
|
|
|
|
}
|
|
|
|
|
print("去电接听");
|
|
|
|
|
}else{
|
|
|
|
|
if(idleSw!){
|
|
|
|
|
print(idleSw);
|
|
|
|
|
print("${phoneNum!}:${call!}");
|
|
|
|
|
Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle!);
|
|
|
|
|
}
|
|
|
|
|
print("去电未接");
|
|
|
|
|
}
|
|
|
|
|
print("发送成功");
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
// if(entry.first.duration!>0){
|
|
|
|
|
// if(callSw!){
|
|
|
|
|
// print(callSw);
|
|
|
|
|
// print("${phoneNum!}:${call!}");
|
|
|
|
|
// // Telephony.backgroundInstance.sendSms(to: phoneNum!, message: call!);
|
|
|
|
|
// }
|
|
|
|
|
// print("去电接听");
|
|
|
|
|
// }else{
|
|
|
|
|
// if(idleSw!){
|
|
|
|
|
// print(idleSw);
|
|
|
|
|
// // ${idle!}
|
|
|
|
|
// print("${phoneNum!}:${call!}");
|
|
|
|
|
// // Telephony.backgroundInstance.sendSms(to: phoneNum!, message: idle!);
|
|
|
|
|
// }
|
|
|
|
|
// print("去电未接");
|
|
|
|
|
// }
|
|
|
|
|
// print("发送成功");
|
|
|
|
|
// }
|
|
|
|
|
flag = 0;
|
|
|
|
|
}
|
|
|
|
|
} else if (callState == "RINGING") {
|
|
|
|
|