forked from Azure/azure-functions-host
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NotificationHub]Add support to send native notifications
- Loading branch information
1 parent
3c9abe2
commit 3d2e32d
Showing
9 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/WebJobs.Script/Description/Binding/NotificationHubBindingMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
||
using Microsoft.Azure.NotificationHubs; | ||
|
||
namespace Microsoft.Azure.WebJobs.Script.Description | ||
{ | ||
internal class NotificationHubBindingMetadata : BindingMetadata | ||
{ | ||
public string TagExpression { get; set; } | ||
|
||
public NotificationPlatform Platform { get; set; } | ||
|
||
public string HubName { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
test/WebJobs.Script.Tests/TestScripts/CSharp/NotificationHubNative/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"bindings": [ | ||
{ | ||
"type": "manualTrigger", | ||
"direction": "in" | ||
}, | ||
{ | ||
"type": "notificationHub", | ||
"direction": "out", | ||
"name": "wnsToastPayload", | ||
"platform": "wns" | ||
} | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
test/WebJobs.Script.Tests/TestScripts/CSharp/NotificationHubNative/run.csx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using System; | ||
public static void Run(string input, out string wnsToastPayload) | ||
{ | ||
wnsToastPayload = "<toast><visual><binding template=\"ToastText01\"><text id=\"1\">Test message from C#</text></binding></visual></toast>"; | ||
} |
14 changes: 14 additions & 0 deletions
14
test/WebJobs.Script.Tests/TestScripts/Node/NotificationHubNative/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"bindings": [ | ||
{ | ||
"type": "manualTrigger", | ||
"direction": "in" | ||
}, | ||
{ | ||
"type": "notificationHub", | ||
"direction": "out", | ||
"name": "wnsToastPayload", | ||
"platform": "wns" | ||
} | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
test/WebJobs.Script.Tests/TestScripts/Node/NotificationHubNative/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = function (context, input) { | ||
context.log('Sending native windows toast notification...'); | ||
context.bindings.wnsToastPayload = "<toast><visual><binding template=\"ToastText01\"><text id=\"1\">Test message from Node!</text></binding></visual></toast>"; | ||
context.done(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters