UssdSession UssdSession UssdSession UssdSession Class

Represents a session of the USSD network protocol.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

Syntax

Declaration

public sealed class UssdSessionpublic sealed class UssdSessionPublic NotInheritable Class UssdSessionpublic sealed class UssdSession

Methods summary

Closes the USSD session with the network.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

Creates a USSD session for the mobile device associated with the supplied network account ID.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

Creates a USSD session for the mobile device associated with the supplied network interface ID.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

Sends a message to a USSD session and returns a handler to retrieve the reply asynchronously.

Note

This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

For permission to use this API, please reach out to Network Operators API Permissions.

For technical help with this API, please reach out to Network Operators API Help

Methods

  • Close()
    Close()
    Close()
    Close()

    Closes the USSD session with the network.

    Note

    This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

    For permission to use this API, please reach out to Network Operators API Permissions.

    For technical help with this API, please reach out to Network Operators API Help

    public void Close()public void Close()Public Function Close() As voidpublic void Close()
  • CreateFromNetworkAccountId(String)
    CreateFromNetworkAccountId(String)
    CreateFromNetworkAccountId(String)
    CreateFromNetworkAccountId(String)

    Creates a USSD session for the mobile device associated with the supplied network account ID.

    Note

    This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

    For permission to use this API, please reach out to Network Operators API Permissions.

    For technical help with this API, please reach out to Network Operators API Help

    public static UssdSession CreateFromNetworkAccountId(String networkAccountId)public static UssdSession CreateFromNetworkAccountId(String networkAccountId)Public Static Function CreateFromNetworkAccountId(networkAccountId As String) As UssdSessionpublic static UssdSession CreateFromNetworkAccountId(String networkAccountId)

    Parameters

    • networkAccountId
      System.String
      System.String
      System.String
      System.String

      The network account ID to use to select the corresponding mobile broadband device to use for the USSD session.

    Returns

  • CreateFromNetworkInterfaceId(String)
    CreateFromNetworkInterfaceId(String)
    CreateFromNetworkInterfaceId(String)
    CreateFromNetworkInterfaceId(String)

    Creates a USSD session for the mobile device associated with the supplied network interface ID.

    Note

    This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

    For permission to use this API, please reach out to Network Operators API Permissions.

    For technical help with this API, please reach out to Network Operators API Help

    public static UssdSession CreateFromNetworkInterfaceId(String networkInterfaceId)public static UssdSession CreateFromNetworkInterfaceId(String networkInterfaceId)Public Static Function CreateFromNetworkInterfaceId(networkInterfaceId As String) As UssdSessionpublic static UssdSession CreateFromNetworkInterfaceId(String networkInterfaceId)

    Parameters

    • networkInterfaceId
      System.String
      System.String
      System.String
      System.String

      The network interface ID to use to select the corresponding mobile broadband device to use for the USSD session.

    Returns

  • SendMessageAndGetReplyAsync(UssdMessage)
    SendMessageAndGetReplyAsync(UssdMessage)
    SendMessageAndGetReplyAsync(UssdMessage)
    SendMessageAndGetReplyAsync(UssdMessage)

    Sends a message to a USSD session and returns a handler to retrieve the reply asynchronously.

    Note

    This functionality is only available to mobile operator apps and Windows Store app given privileged access by mobile network operators.

    For permission to use this API, please reach out to Network Operators API Permissions.

    For technical help with this API, please reach out to Network Operators API Help

    public IAsyncOperation<UssdReply> SendMessageAndGetReplyAsync(UssdMessage message)public IAsyncOperation<UssdReply> SendMessageAndGetReplyAsync(UssdMessage message)Public Function SendMessageAndGetReplyAsync(message As UssdMessage) As IAsyncOperation( Of UssdReply )public IAsyncOperation<UssdReply> SendMessageAndGetReplyAsync(UssdMessage message)

    Parameters

    Returns

    • An asynchronous handler to retrieve the USSD response to the sent message.

    Remarks

    The USSD message being sent can be either a request or a response. The operation is asynchronous and issues a single callback using the IAsyncOperation<TResult> interface upon completion. You can cancel the asynchronous operation using the IAsyncOperation<TResult> interface.

    When an application using the C++ projection of SendMessageAndGetReplyAsync(UssdMessage) releases its last reference to the UssdSession object from within that callback, SendMessageAndGetReplyAsync(UssdMessage) may hang. Therefore, applications must ensure that the callback is not released from within SendMessageAndGetReplyAsync(UssdMessage). One way of doing this is to create another asynchronous operation (e.g. a timer) from within the callback whose completion callback is used to release the session object by passing it a reference to the session object.

    auto timerDelegate = [ussdSession](Windows::System::Threading::ThreadPoolTimer^ timer) {};
    Windows::Foundation::TimeSpan delay;
    delay.Duration = 1; // non-zero value
    Windows::System::Threading::ThreadPoolTimer^ timer = 
    Windows::System::Threading::ThreadPoolTimer::CreateTimer(ref new
    Windows::System::Threading::TimerElapsedHandler(timerDelegate), delay);
    

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute

Details

Assembly

Windows.Networking.NetworkOperators.dll