System.Tether.AppProfile.TTetheringAppProfile.Notify

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Notify(const ANotification, Data: string); override;

C++

virtual void __fastcall Notify(const System::UnicodeString ANotification, const System::UnicodeString Data);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Tether.AppProfile.pas
System.Tether.AppProfile.hpp
System.Tether.AppProfile TTetheringAppProfile

Description

Handles a notification from the manager originally sent by a remote profile.

Note: You do not need to call Notify when you use TTetheringAppProfile. However, you might want to reimplement Notify if you subclass TTetheringAppProfile or TTetheringProfile.

Notify receives the following parameters:

  • The ANotification string.
  • The Data string contains several parameters separated by a token, #*#.

Possible Values of ANotification

Value Description

"NOT_SNDRES"

Announces that a temporal remote resource containing a string has been sent by a remote application profile and is waiting for you to fetch it.

Data provides the following parameters:

  1. The ID of the remote profile that sends the string.
  2. The name of the remote resource.
  3. The hint of the remote resource.
  4. The resource type of the remote resource.
  5. The string.

"NOT_UPDPRO"

Announces that a remote application profile has changed.

Data provides a single parameter: the ID of the remote profile that changed.

"NOT_UPDRES"

Announces that a remote item published by a remote application profile has changed.

Data provides the following parameters:

  1. The ID of the remote profile that publishes the remote item.
  2. The name of the remote item.
  3. A JSON representation of the remote item new data.

Converting Data into an Array

In Delphi:

Parameters := Data.Split(['#*#'], TStringSplitOptions.None);

In C++:

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/iter_find.hpp>

std::list<std::wstring> Parameters;
std::wstring DataAsWideString = Data.w_str();
boost::iter_split(Parameters, DataAsWideString, boost::first_finder(L"#*#"));

See Also