Merged PR 14280: Cleanup GraphNotificationsSample for next release
Fixed copyright header and removed commented code. Cherry picked from !14185
This commit is contained in:
Родитель
7bef38f26d
Коммит
239def127c
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
package com.microsoft.connecteddevices.graphnotifications;
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
package com.microsoft.connecteddevices.graphnotifications;
|
||||
|
||||
import android.app.Activity;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
package com.microsoft.connecteddevices.graphnotifications;
|
||||
|
||||
import android.content.Context;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
package com.microsoft.connecteddevices.graphnotifications;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace SDKTemplate
|
|||
|
||||
if (ConnectedDevicesManager == null)
|
||||
{
|
||||
Logger.Instance.LogMessage($"Setup AccountsProvider and NotificationsProvider");
|
||||
Logger.Instance.LogMessage($"Setup ConnectedDevicesManager");
|
||||
ConnectedDevicesManager = new ConnectedDevicesManager();
|
||||
}
|
||||
|
||||
|
@ -165,16 +165,14 @@ namespace SDKTemplate
|
|||
{
|
||||
var rawNotification = args.TaskInstance.TriggerDetails as RawNotification;
|
||||
Logger.Instance.LogMessage($"RawNotification received {rawNotification.Content}");
|
||||
|
||||
if (ConnectedDevicesManager == null)
|
||||
{
|
||||
Logger.Instance.LogMessage($"Setup ConnectedDevicesManager");
|
||||
ConnectedDevicesManager = new ConnectedDevicesManager();
|
||||
}
|
||||
|
||||
await ConnectedDevicesManager.ReceiveNotificationAsync(rawNotification.Content);
|
||||
|
||||
// HACK: Crack the push body to extract the notificationId
|
||||
// var result = JsonConvert.DeserializeObject<RawNotificationPayload>(rawNotification.Content);
|
||||
// var notificationId = result.activities != null && result.activities.Count > 0 ? result.activities[0].id : "Graph Notifications";
|
||||
// var toast = ConnectedDevicesManager.BuildToastNotification(notificationId, "New notification");
|
||||
// var toastNotifier = Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier();
|
||||
// toastNotifier.Show(toast);
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(15));
|
||||
}
|
||||
|
||||
Logger.Instance.LogMessage($"Task completed");
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
//
|
||||
// AppDelegate.h
|
||||
// GraphNotifications
|
||||
//
|
||||
// Created by Allen Ballway on 8/23/18.
|
||||
// Copyright © 2018 Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
#import "NotificationsManager.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#import <UIKit/UIKit.h>
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
//
|
||||
// DataViewController.m
|
||||
// GraphNotifications
|
||||
//
|
||||
// Created by Allen Ballway on 8/23/18.
|
||||
// Copyright © 2018 Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import "LoginViewController.h"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NotificationsManager.h"
|
||||
#import "Secrets.h"
|
||||
#import "AppDelegate.h"
|
||||
#import <UserNotifications/UserNotifications.h>
|
||||
|
||||
|
||||
static NotificationsManager* s_manager;
|
||||
|
||||
@interface NotificationsManager ()
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "NotificationsViewController.h"
|
||||
|
||||
|
||||
@interface NotificationsViewController()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface RootViewController : UIViewController
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
//
|
||||
// RootViewController.m
|
||||
// GraphNotifications
|
||||
//
|
||||
// Created by Allen Ballway on 8/23/18.
|
||||
// Copyright © 2018 Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RootViewController.h"
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
//
|
||||
// main.m
|
||||
// GraphNotifications
|
||||
//
|
||||
// Created by Allen Ballway on 8/23/18.
|
||||
// Copyright © 2018 Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
|
Загрузка…
Ссылка в новой задаче