Skip to content

Commit

Permalink
finished #28
Browse files Browse the repository at this point in the history
  • Loading branch information
theClarkSell committed Nov 27, 2012
1 parent 67cda5d commit 6cb4b66
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
Binary file not shown.
@@ -0,0 +1,2 @@
[InternetShortcut]
URL=http://31daysofwindows8.com/push
1 change: 1 addition & 0 deletions source/HTML5/Day28-PushNotifications/app/app/app.jsproj
Expand Up @@ -54,6 +54,7 @@
<AppxManifest Include="package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<Content Include="js\scratch.js" />
<None Include="app_TemporaryKey.pfx" />
<None Include="app_StoreKey.pfx" />
<Content Include="default.html" />
Expand Down
13 changes: 8 additions & 5 deletions source/HTML5/Day28-PushNotifications/app/app/js/default.js
Expand Up @@ -11,9 +11,7 @@
var notify = Windows.UI.Notifications;
var push = Windows.Networking.PushNotifications;
var net = Windows.Networking.Connectivity;
var wsc = Windows.Security.Cryptography;
var popups = Windows.UI.Popups;


app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
Expand All @@ -30,8 +28,13 @@
var profile = net.NetworkInformation.getInternetConnectionProfile();

if (profile.getNetworkConnectivityLevel() === net.NetworkConnectivityLevel.internetAccess) {
push.PushNotificationChannelManager.createPushNotificationChannelForApplicationAsync().then(function (channel) {
document.querySelector("#uri").innerText = channel.uri
push.PushNotificationChannelManager.createPushNotificationChannelForApplicationAsync()
.then(function (channel) {
document.querySelector("#uri").innerText = channel.uri;

/*
this would be the place to post your uri to your cloud service.
*/
})
}

Expand Down
1 change: 1 addition & 0 deletions source/HTML5/Day28-PushNotifications/app/app/js/scratch.js
@@ -0,0 +1 @@

Expand Up @@ -22,7 +22,6 @@
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
<Capability Name="privateNetworkClientServer" />
<Capability Name="internetClient" />
</Capabilities>
</Package>

0 comments on commit 6cb4b66

Please sign in to comment.