Skip to content

How to get RemoteID working? #28

Open

Description

@vitordelucca

So I tried a few things, but no luck.
By RemoteID, I mean, Universal Dismiss. I didn't find any DOC also, just the MSDN article talking about it.
Any help would be appreciated.

Where I want to implement it:

foreach(Tuple<string, string, string> newNote in newNotifications)
{
// Make the visual
ToastVisual visual = new ToastVisual();
visual.TitleText = new ToastText() { Text = newNote.Item1 };
if(!String.IsNullOrWhiteSpace(newNote.Item2))
{
visual.BodyTextLine1 = new ToastText() { Text = newNote.Item2 };
}

                // Make the toast content
                ToastContent toastContent = new ToastContent();
                toastContent.Visual = visual;
                toastContent.Launch = c_messageInboxOpenArgument;
                toastContent.ActivationType = ToastActivationType.Foreground;
                toastContent.Duration = ToastDuration.Short;

                var toast = new ToastNotification(toastContent.GetXml());
                toast.Tag = newNote.Item3;



                // Only show if we should and this is the first message to show.
                toast.SuppressPopup = hasShownNote || updateSliently || AddToNotificationCenterSilently;
                ToastNotificationManager.CreateToastNotifier().Show(toast);

                // Mark that we have shown one.
                hasShownNote = true;
            }

full code to better understanding: https://github.com/vitorgrs/Reddunt/blob/rd_develop_rs1/BaconBackend/Managers/Background/BackgroundMessageUpdater.cs
PS: Not getting markdown insert code working. Sorry.

Activity

  1. andrewleader commented on Aug 1, 2016

    @andrewleader
    Member

    Hey! You're correct that the latest documentation is the MSDN blog article: https://blogs.msdn.microsoft.com/tiles_and_toasts/2016/06/10/action-center-in-the-cloud-universal-dismiss/

    So you added the RemoteId, installed the app on both your phone and PC, and popped the notification with the same RemoteId? And you're logged into Cortana with your MSA on both of your devices? And when you dismissed one, the other didn't dismiss?

    What build are you on?

  2. vitordelucca commented on Aug 1, 2016

    @vitordelucca
    Author

    I'm on 14393 with 14388 SDK. And the problem here is that it doesn't recognize account and homework. "The name 'account' does not exist in the current context".
    Also tried following this method but not luck too. :/

  3. andrewleader commented on Aug 4, 2016

    @andrewleader
    Member

    Oh, "account" and "homework" are local variables to my own app... you'll have to generate your own RemoteId string using variables that make sense to your app.

    What are you sending a notification for? If you tell me what you're sending a notification about, I could help suggest what you should use to generate your RemoteId!

  4. vitordelucca commented on Aug 4, 2016

    @vitordelucca
    Author

    I'm sending a pull toast (timer, check every 15 min). It's Reddunt app, Baconit fork :)
    https://github.com/vitorgrs/Reddunt/blob/rd_develop_rs1/BaconBackend/Managers/Background/BackgroundMessageUpdater.cs

  5. andrewleader commented on Aug 17, 2016

    @andrewleader
    Member

    Ah I saw Reddunt on the WindowsPhone subreddit :P

    Sorry I forgot to reply, if you haven't figured out what to do for the RemoteId, I just took a look at that code and here's my suggestion...

    Is "message.Id" something that is consistent across devices? For example, is the "Id" property something that the Reddit server provides? And therefore the message ID for a message will be the same on two different devices?

    If so, you should use that for the RemoteId (you already use it for Tag, you can use it for RemoteId too).

    So at line #213, I would do

    toast.RemoteId = "Message_" + newNote.Item3;
    

    And that should work, assuming that the message ID is something that's shared across devices and therefore can identify the same message across devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions