ContactVideoCallActivatedEventArgs クラス

定義

アプリがビデオ通話の連絡先に対してアクティブ化されたときにデータを提供します。

Javascript この型は 、WebUIContactVideoCallActivatedEventArgs として表示されます。

public ref class ContactVideoCallActivatedEventArgs sealed : IActivatedEventArgs, IContactVideoCallActivatedEventArgs
/// [Windows.Foundation.Metadata.ContractVersion(Windows.ApplicationModel.Activation.ContactActivatedEventsContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ContactVideoCallActivatedEventArgs final : IActivatedEventArgs, IContactVideoCallActivatedEventArgs
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.ApplicationModel.Activation.ContactActivatedEventsContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ContactVideoCallActivatedEventArgs : IActivatedEventArgs, IContactVideoCallActivatedEventArgs
Public NotInheritable Class ContactVideoCallActivatedEventArgs
Implements IActivatedEventArgs, IContactVideoCallActivatedEventArgs
継承
Object Platform::Object IInspectable ContactVideoCallActivatedEventArgs
属性
実装

Windows の要件

デバイス ファミリ
Windows Desktop Extension SDK (10.0.10240.0 で導入)
API contract
Windows.ApplicationModel.Activation.ContactActivatedEventsContract (v1.0 で導入)

Skype ID の連絡先ビデオ通話のアクティブ化を処理するために必要なコードの例を次に示します。

protected override void OnActivated(IActivatedEventArgs args)
{
    if (args.Kind == ActivationKind.Contact)
    {
        var contactArgs = args as IContactActivatedEventArgs;
        if (contactArgs.Verb == Windows.ApplicationModel.Contacts.ContactLaunchActionVerbs.VideoCall)
        {
            IContactVideoCallActivatedEventArgs videoCallArgs = contactArgs as IContactVideoCallActivatedEventArgs;

            //get contact display info
            var contactName = videoCallArgs.Contact.DisplayName;
            var contactThumbnail = videoCallArgs.Contact.Thumbnail;

            if (videoCallArgs.ServiceId == "skype.com")
            {
                var userId = videoCallArgs.ServiceUserId;
                //add video calling logic for Skype Ids
            }
        }
    }
}
void App::OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs const& args)
{
    if (args.Kind() == Windows::ApplicationModel::Activation::ActivationKind::Contact)
    {
        auto contactArgs{ args.as<Windows::ApplicationModel::Activation::IContactActivatedEventArgs>() };
        if (contactArgs.Verb() == Windows::ApplicationModel::Contacts::ContactLaunchActionVerbs::VideoCall())
        {
            auto videoCallArgs{ contactArgs.as<Windows::ApplicationModel::Activation::ContactVideoCallActivatedEventArgs>() };

            // Get contact display info.
            auto contactName{ videoCallArgs.Contact().DisplayName() };
            auto contactThumbnail{ videoCallArgs.Contact().Thumbnail() };

            if (videoCallArgs.ServiceId() == L"skype.com")
            {
                auto userId = videoCallArgs.ServiceUserId();
                //add messaging logic for Skype Ids
            }
        }
    }
}
void App::OnActivated(IActivatedEventArgs^ args)
{
    if (args->Kind == ActivationKind::Contact)
    {
        auto contactArgs = dynamic_cast<IContactActivatedEventArgs^>(args);
        if (contactArgs->Verb == Windows::ApplicationModel::Contacts::ContactLaunchActionVerbs::VideoCall)
        {
            auto videoCallArgs = dynamic_cast<ContactVideoCallActivatedEventArgs^>(contactArgs);

            //get contact display info
            auto contactName = videoCallArgs->Contact->DisplayName;
            auto contactThumbnail = videoCallArgs->Contact->Thumbnail;

            if (videoCallArgs->ServiceId == "skype.com")
            {
                auto userId = videoCallArgs->ServiceUserId;
                //add video calling logic for Skype Ids
            }
        }
    }
}

注釈

Windows 8.1を使用すると、ユーザーは連絡先カードまたは Windows Search エクスペリエンスから連絡先にビデオ通話を行うことができます。 連絡先ビデオ通話のアクティブ化コントラクトを実装することで、Windows はアプリを起動してユーザーにビデオ通話を行うことができます。

ビデオ通話のアクティブ化を受信するには、アプリのマニフェストで "windows.contact" 拡張機能カテゴリに登録する必要があります。 この拡張機能では、"Verb" 属性が "videoCall" と等しい "LaunchAction" 要素を含める必要があります。その後、"ServiceId" 要素を指定して、アプリでビデオ通話を実行できるサービスのドメイン名 ("skype.com" など) を指定できます。

このコントラクトに複数のアプリが登録されている場合、ユーザーはビデオ通話を処理するための既定値としてそのうちの 1 つを選択できます。

マニフェスト登録の例を次に示します。

<m2:Extension Category="windows.contact" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
  <m2:Contact>
    <m2:ContactLaunchActions>
      <m2:LaunchAction Verb="videoCall" DesiredView="useHalf">
        <m2:ServiceId>skype.com</m2:ServiceId>
      </m2:LaunchAction>
    </m2:ContactLaunchActions>
  </m2:Contact>
</m2:Extension>

マニフェストに登録すると、連絡先ビデオ通話コントラクトに対してアプリをアクティブ化できます。 アプリがアクティブ化されると、イベント情報を使用してビデオ通話のアクティブ化を識別し、ユーザーのビデオ通話を完了するのに役立つパラメーターを抽出できます。

プロパティ

Contact

ビデオ通話の連絡先を取得します。

Kind

アクティブ化の種類を取得します。

PreviousExecutionState

アクティブ化される前のアプリの実行状態を取得します。

ServiceId

ビデオ通話に使用されるサービスの識別子を取得します。

ServiceUserId

ビデオ通話に使用されるサービスのユーザー識別子を取得します。

SplashScreen

スプラッシュ スクリーン からアクティブ化されたアプリへの切り替えに関する情報を提供するスプラッシュ スクリーン オブジェクトを取得します。

Verb

実行するアクションを取得します。

適用対象

こちらもご覧ください