Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UssdSession.SendMessageAndGetReplyAsync | sendMessageAndGetReplyAsync method

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 apps given privileged access by mobile network operators. For more information, see Mobile Broadband: Windows Store device apps.

Syntax


ussdSession.sendMessageAndGetReplyAsync(message).done( /* Your success and error handlers */ );

Parameters

message

Type: UssdMessage

The message to send to the USSD session.

Return value

Type: IAsyncOperation<UssdReply>

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(UssdReply) interface upon completion. You can cancel the asynchronous operation using the IAsyncOperation(UssdReply) interface.

When an application using the C++ projection of SendMessageAndGetReplyAsync releases its last reference to the UssdSession object from within that callback, SendMessageAndGetReplyAsync may hang. Therefore, applications must ensure that the callback is not released from within SendMessageAndGetReplyAsync. 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);

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.NetworkOperators
Windows::Networking::NetworkOperators [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Networking.NetworkOperators
Windows::Networking::NetworkOperators [C++]

Metadata

Windows.winmd

See also

UssdSession

 

 

Show:
© 2015 Microsoft