-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b483365
commit 67cda5d
Showing
11 changed files
with
523 additions
and
29 deletions.
There are no files selected for viewing
Binary file modified
BIN
+660 KB
(190%)
blogPosts/html5/31 Days of Windows 8 Day #28 Push Notifications.wpost
Binary file not shown.
367 changes: 367 additions & 0 deletions
367
source/HTML5/Day28-PushNotifications/app/app/Package.StoreAssociation.xml
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
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
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
Binary file added
BIN
+283 KB
website/source/App_Data/packages/WnsRecipe.0.0.3.2/WnsRecipe.0.0.3.2.nupkg
Binary file not shown.
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,105 @@ | ||
@using NotificationsExtensions; | ||
@using NotificationsExtensions.ToastContent; | ||
@using NotificationsExtensions.TileContent; | ||
|
||
|
||
@{ | ||
|
||
if ( IsPost ) { | ||
try { | ||
var sid = Request["sid"]; | ||
var secret = Request["secret"]; | ||
var uri = Request["uri"]; | ||
var message = Request["message"]; | ||
|
||
WnsAccessTokenProvider tokenProvider = new WnsAccessTokenProvider(sid, secret); | ||
|
||
var title = "31 Days"; | ||
var subText = message; | ||
|
||
var tileNotification = TileContentFactory.CreateTileWideText01(); | ||
|
||
tileNotification.RequireSquareContent = false; | ||
|
||
tileNotification.TextHeading.Text = "31 days"; | ||
tileNotification.TextBody1.Text = message; | ||
|
||
var tileResult = tileNotification.Send(new Uri(uri), tokenProvider).ErrorDescription; | ||
|
||
if (!string.IsNullOrEmpty(tileResult) ){ | ||
<h1>tile result: @tileResult</h1> | ||
} | ||
|
||
var toastNotification = ToastContentFactory.CreateToastText02(); | ||
toastNotification.TextHeading.Text = "31 Days"; | ||
toastNotification.TextBodyWrap.Text = message; | ||
|
||
var toastResult = toastNotification.Send(new Uri(uri), tokenProvider ).ErrorDescription; | ||
|
||
if (!string.IsNullOrEmpty(toastResult) ){ | ||
<h1>toast result: @toastResult</h1> | ||
} | ||
} | ||
catch ( Exception e ) { | ||
<h1>@e.Message</h1> | ||
} | ||
} | ||
|
||
} | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>31 Days - Push Notification Tester</title> | ||
|
||
<style> | ||
ul { | ||
list-style: none; | ||
} | ||
label { | ||
display: block; | ||
} | ||
input { | ||
width: 100%; | ||
} | ||
button { | ||
width: 150px; | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<form method=post> | ||
<fieldset> | ||
<ul id="formContainer"> | ||
|
||
<li> | ||
<label>sid:</label> | ||
<input name="sid" type="text"> | ||
</li> | ||
<li> | ||
<label>secret:</label> | ||
<input name="secret" type="text"> | ||
</li> | ||
<li> | ||
<label>uri:</label> | ||
<input name="uri" type="url"> | ||
</li> | ||
|
||
<li> | ||
<label>message:</label> | ||
<input name="message" type="text"> | ||
</li> | ||
</ul> | ||
<button id="go" type=submit value=submit>send</button> | ||
</fieldset> | ||
</form> | ||
</body> | ||
</html> |
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,19 +1,46 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<?xml version="1.0"?> | ||
<configuration> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> | ||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral"/> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> | ||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral"/> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> | ||
</dependentAssembly> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" /> | ||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" culture="neutral"/> | ||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
<system.diagnostics> | ||
<sources> | ||
<source name="WNSRecipe" switchValue="Off"> | ||
<listeners> | ||
<!-- | ||
Uncomment one or more entries in this section or add your own custom trace listeners to enable trace logs from the WNS Recipe. Note | ||
that some trace listeners in this section may require additional configuration steps such as configuring output file location, setting | ||
file permissions, creating event sources, etc. For additional information on trace listener configuration, please refer to | ||
http://msdn.microsoft.com/en-us/library/ff664708.aspx and http://msdn.microsoft.com/en-us/library/4y5y10s7.aspx. | ||
--> | ||
<!-- Windows Azure Log --> | ||
<!--<add name="Azure" type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />--> | ||
<!-- Windows Event Log --> | ||
<!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" initializeData="WNS Recipe Notifications"/>--> | ||
<!-- Delimited text file --> | ||
<!--<add name="LogFile" type="System.Diagnostics.DelimitedListTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" initializeData="[TRACE FILE NAME (e.g. c:\temp\sampleDelimitedFile.txt)]" />--> | ||
<!-- XML file --> | ||
<!--<add name="XmlFile" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" initializeData="c:\temp\sampleLogFile.xml" />--> | ||
<!-- Console --> | ||
<!--<add name="Console" type="System.Diagnostics.ConsoleTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" traceOutputOptions="None"/>--> | ||
</listeners> | ||
</source> | ||
</sources> | ||
</system.diagnostics> | ||
<system.web> | ||
<compilation debug="true"/> | ||
</system.web> | ||
</configuration> |