AchievementNotifier.GetTitleIdFilteredSource Method

Registers an app to receive notifications for achievements that are unlocked for its own title ID.

Syntax

public:
static AchievementSource^ GetTitleIdFilteredSource()  

Return value

Type: AchievementSource 

Returns an AchievementSource object which can be used to assign an event handler for achievement unlocked events.

Requirements

Namespace: Windows.Xbox.Achievements

Metadata: windows.winmd

Example

using namespace Windows::Xbox::Achievements;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;

class MyApp
{
  void registerForAchievementUnlocked()
  {
    AchievementSource^ achievementSource = AchievementNotifier->GetFilteredSource();
    achievementSource.AchievementUnlocked = ref new EventHandler<AchievementUnlockedEventArgs^>(
      [&] (Object^, AchievementUnlockedEventArgs^ args)
      {
        Windows::Xbox::System::IUser^ unlockingUser = args->User;
        String^ achievementId = args->AchievementId;
        IVectorView<String^> rewards = args->InAppRewardValue;
        // App can now update UI, trigger rewards, etc, based on achievement being unlocked
      });			    
  }
};  

See also

Reference

AchievementNotifier Class

AchievementNotifier Members

Windows.Xbox.Achievements Namespace