The dialer is not showing full ussd code eg: *123*1#

后端 未结 2 381
离开以前
离开以前 2021-01-22 06:47

I am using the url_launcher plugin for call, but the dialer is not showing the # character:

String url = \'tel:*123#\';
if (await canLa         


        
2条回答
  •  星月不相逢
    2021-01-22 07:21

    Disclaimer: plugin author here.

    Do you want the phone call user interface to open or would you rather make the request silently? If you prefer to do it without popping the phone call UI, Android introduced in API level 26 the method sendUssdRequest.

    I made a Flutter plugin called ussd_service to be able to easily access it from dart in a Flutter application. It can be used in the following manner:

    import 'package:ussd_service/ussd_service.dart';
    
    makeMyRequest() async {
      int subscriptionId = 1; // sim card subscription Id
      String code = "*21#"; // ussd code payload
      try {
        String ussdSuccessMessage = await UssdService.makeRequest(subscriptionId, code);
        print("succes! message: $ussdSuccessMessage");
      } on PlatformException catch (e) {
        print("error! code: ${e.code} - message: ${e.message}");
      }
    };
    
    makeMyRequest();
    

    Hope this helps! Let me know on the Github repo's issues if you have any issue with it.

提交回复
热议问题