added native Windows example for push notifications.

This commit is contained in:
nsndeck 2014-06-06 16:11:08 +03:00
Родитель 5dd6540a14
Коммит 273b58de20
26 изменённых файлов: 3178 добавлений и 3 удалений

2
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
bin
obj

20
App.xaml Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<Application
x:Class="WindowsPushSample.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WindowsPushSample">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--
Styles that define common aspects of the platform look and feel
Required by Visual Studio project and item templates
-->
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

90
App.xaml.cs Normal file
Просмотреть файл

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227
namespace WindowsPushSample
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

Двоичные данные
Assets/Logo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 801 B

Двоичные данные
Assets/SmallLogo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 329 B

Двоичные данные
Assets/SplashScreen.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичные данные
Assets/SplashScreen.scale-100.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.0 KiB

Двоичные данные
Assets/StoreLogo.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 429 B

Двоичные данные
Assets/tile_telerik_platform_150x150.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 6.4 KiB

Двоичные данные
Assets/tile_telerik_platform_24x24.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичные данные
Assets/tile_telerik_platform_30x30.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичные данные
Assets/tile_telerik_platform_50x50.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.7 KiB

Двоичные данные
Assets/tile_telerik_platform_620x300.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 7.0 KiB

1829
Common/StandardStyles.xaml Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Data;
namespace WindowsPushSample
{
public class InverseBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (targetType != typeof(bool))
throw new InvalidOperationException("The target must be a boolean");
return !(bool)value;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}

132
MainPage.xaml Normal file
Просмотреть файл

@ -0,0 +1,132 @@
<Page
x:Class="WindowsPushSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WindowsPushSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<local:InverseBooleanConverter x:Name="inverseBooleanConverter" />
</Page.Resources>
<Grid Background="#2D3F51">
<Grid.RowDefinitions>
<RowDefinition Height="300" />
<RowDefinition Height="*" />
<RowDefinition Height="200" />
</Grid.RowDefinitions>
<Grid Margin="35" Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="940" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Button Content="Register" Click="OnRegisterClick"
Grid.Column="0" Grid.Row="0" Width="200" Padding="5"
IsEnabled="{Binding IsDeviceRegistered, Converter={StaticResource inverseBooleanConverter}}"/>
<Button Content="Unregister" Click="OnUnregisterClick"
Grid.Column="0" Grid.Row="1" Width="200" Padding="5"
IsEnabled="{Binding IsDeviceRegistered}"/>
<Grid Grid.Column="1" Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Toast message:"
Grid.Column="0"
Margin="3, 7, 0, 7" Padding="3" FontSize="20"/>
<TextBox x:Name="pushNotificationMessage"
Grid.Column="1" Margin="3, 7, 0, 7" Padding="3"
HorizontalAlignment="Stretch"
Text="My first Windows Push Notification!"
IsEnabled="{Binding IsDeviceRegistered}"/>
</Grid>
<Button Content="Send Push Notification" Click="OnSendClick"
Grid.Column="1" Grid.Row="1" Width="200" Padding="5"
IsEnabled="{Binding IsDeviceRegistered}"/>
</Grid>
<Grid Grid.Row="1" Margin="35, 0, 0, 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="940" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<Button Content="Pin Second Tile" Click="OnPinSecondTileClick"
Grid.Column="0" Grid.Row="0" Width="200" Padding="5"
IsEnabled="{Binding IsSecondaryTilePinned, Converter={StaticResource inverseBooleanConverter}}"/>
<Button Content="Register Second Tile" Click="OnRegisterSecondTileClick"
Grid.Column="0" Grid.Row="1" Width="200" Padding="5"
IsEnabled="{Binding ShowRegisterSecondTileButton}"/>
<Button Content="Unpin Second Tile" Click="OnUnpinSecondTileClick"
Grid.Column="0" Grid.Row="3" Width="200" Padding="5"
IsEnabled="{Binding IsSecondaryTilePinned}"/>
<Button Content="Unregister Second Tile" Click="OnUnregisterSecondTileClick"
Grid.Column="0" Grid.Row="4" Width="200" Padding="5"
IsEnabled="{Binding IsSecondaryTileRegistered}"/>
<Grid Grid.Column="1" Grid.Row="0" Grid.RowSpan="5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="370" />
<ColumnDefinition Width="100" />
<ColumnDefinition Width="370" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Text="Text1:" Grid.Column="0" Grid.Row="0" FontSize="20" Margin="3, 7, 0, 7" Padding="3"/>
<TextBlock Text="Text2:" Grid.Column="0" Grid.Row="1" FontSize="20" Margin="3, 7, 0, 7" Padding="3"/>
<TextBlock Text="Text3:" Grid.Column="0" Grid.Row="2" FontSize="20" Margin="3, 7, 0, 7" Padding="3"/>
<TextBlock Text="Text4:" Grid.Column="0" Grid.Row="3" FontSize="20" Margin="3, 7, 0, 7" Padding="3"/>
<TextBox x:Name="text1" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch"
Margin="3, 7, 0, 7" Padding="3"
IsEnabled="{Binding IsSecondaryTileRegistered}"
Text="WindowsPushSample"/>
<TextBox x:Name="text2" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch"
Margin="3, 7, 0, 7" Padding="3"
IsEnabled="{Binding IsSecondaryTileRegistered}"
Text="Text2"/>
<TextBox x:Name="text3" Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch"
Margin="3, 7, 0, 7" Padding="3"
IsEnabled="{Binding IsSecondaryTileRegistered}"
Text="Text3"/>
<TextBox x:Name="text4" Grid.Column="1" Grid.Row="3" HorizontalAlignment="Stretch"
Margin="3, 7, 0, 7" Padding="3"
IsEnabled="{Binding IsSecondaryTileRegistered}"
Text="Text4"/>
<TextBlock Text="Image1:" Grid.Column="2" Grid.Row="0" FontSize="20" Margin="3, 7, 0, 7" Padding="3"/>
<TextBox x:Name="image1" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Stretch"
Margin="3, 7, 0, 7" Padding="3"
IsEnabled="{Binding IsSecondaryTileRegistered}"
Text=".\Assets\tile_telerik_platform_150x150.png"/>
<Button Content="Send Push Second Tile" Click="OnSendPushToSecondTileClick"
Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="4" Width="200" Padding="5"
HorizontalAlignment="Left"
IsEnabled="{Binding IsSecondaryTileRegistered}"/>
</Grid>
</Grid>
<TextBlock x:Name="statusText" Grid.Row="2" Margin="10" FontSize="16" Padding="5"
VerticalAlignment="Bottom"/>
<Image x:Name="logo" Grid.Row="2"
Source="Assets/tile_telerik_platform_150x150.png"
VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="150" Height="150"
ImageFailed="Image_ImageFailed"/>
</Grid>
</Page>

457
MainPage.xaml.cs Normal file
Просмотреть файл

@ -0,0 +1,457 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using Telerik.Everlive.Sdk.Core;
using Telerik.Everlive.Sdk.Core.Model.System;
using Telerik.Everlive.Sdk.Core.Model.System.Push;
using Telerik.Everlive.Sdk.Core.Transport;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI;
using Windows.UI.Popups;
using Windows.UI.StartScreen;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace WindowsPushSample
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page, INotifyPropertyChanged
{
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
private bool isDeviceRegistered;
public bool IsDeviceRegistered
{
get
{
return this.isDeviceRegistered;
}
set
{
if (this.isDeviceRegistered != value)
{
this.isDeviceRegistered = value;
this.OnPropertyChanged("IsDeviceRegistered");
this.UpdateShowRegisterSecondTileButton();
}
}
}
private bool isSecondaryTileRegistered;
public bool IsSecondaryTileRegistered
{
get
{
return this.isSecondaryTileRegistered;
}
set
{
if (this.isSecondaryTileRegistered != value)
{
this.isSecondaryTileRegistered = value;
this.OnPropertyChanged("IsSecondaryTileRegistered");
this.UpdateShowRegisterSecondTileButton();
}
}
}
private bool isSecondaryTilePinned;
public bool IsSecondaryTilePinned
{
get
{
return this.isSecondaryTilePinned;
}
set
{
if (this.isSecondaryTilePinned != value)
{
this.isSecondaryTilePinned = value;
this.OnPropertyChanged("IsSecondaryTilePinned");
this.UpdateShowRegisterSecondTileButton();
}
}
}
private bool showRegisterSecondTileButton;
public bool ShowRegisterSecondTileButton
{
get
{
return this.showRegisterSecondTileButton;
}
set
{
if (this.showRegisterSecondTileButton != value)
{
this.showRegisterSecondTileButton = value;
this.OnPropertyChanged("ShowRegisterSecondTileButton");
}
}
}
private void UpdateShowRegisterSecondTileButton()
{
if (this.IsSecondaryTilePinned && this.IsDeviceRegistered)
{
if (this.IsSecondaryTileRegistered)
{
this.ShowRegisterSecondTileButton = false;
}
else
{
this.ShowRegisterSecondTileButton = true;
}
}
else
{
this.ShowRegisterSecondTileButton = false;
}
}
private const String SecondaryTileId = "SecondaryTileId";
private const String BackendServicesApiKey = "l7W44IWjTGDq0V7l";
EverliveApp everliveApp;
//private const String BackendServicesApiKey = "your-api-key-here";
public MainPage()
{
this.InitializeComponent();
this.DataContext = this;
if (MainPage.BackendServicesApiKey.StartsWith("your"))
{
MessageDialog msgDialog = new MessageDialog("You need to set a valid Telerik Backend Services API Key!", "Windows Push Sample");
UICommand okBtn = new UICommand("OK");
okBtn.Invoked = OkBtnClick;
msgDialog.Commands.Add(okBtn);
msgDialog.ShowAsync();
}
else
{
everliveApp = new EverliveApp(MainPage.BackendServicesApiKey);
everliveApp.AppSettings.ServiceUrl = "localhost:3000";
this.CheckRegistration();
this.CheckSecondaryTiles();
this.CheckSecondaryTileRegistration();
}
}
private void OkBtnClick(IUICommand command)
{
Application.Current.Exit();
}
private void CheckRegistration()
{
var result = everliveApp.WorkWith().Push().CurrentDevice.GetRegistration().ExecuteSync(5000);
if (result != null)
{
this.IsDeviceRegistered = true;
}
else
{
this.IsDeviceRegistered = false;
}
}
private void CheckSecondaryTileRegistration()
{
if (this.IsDeviceRegistered)
{
var result = everliveApp.WorkWith().Push().CurrentDevice.GetRegistration().ExecuteSync(5000);
if (result != null && result.SecondaryPushTokens != null)
{
Dictionary<string, PushTokenDetails> secondaryTiles = result.SecondaryPushTokens;
string base64TileId = Convert.ToBase64String(Encoding.UTF8.GetBytes(MainPage.SecondaryTileId));
this.IsSecondaryTileRegistered = secondaryTiles.ContainsKey(base64TileId);
}
}
else
{
this.IsSecondaryTileRegistered = false;
}
}
/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
private void OnRegisterClick(object sender, RoutedEventArgs e)
{
try
{
var result = everliveApp.WorkWith().Push().CurrentDevice
.Register(new DeviceParameters())
.ExecuteSync(5000);
if (result.CreatedAt != null)
{
this.SetSuccessStatus("Device registered successfully!");
this.IsDeviceRegistered = true;
}
else
{
this.SetErrorMessage("Cannot register device!");
}
}
catch (EverliveException ex)
{
this.SetErrorMessage("Error on registering device: " + ex.Message);
}
catch (AggregateException aggEx)
{
StringBuilder sb = new StringBuilder();
foreach (var exception in aggEx.InnerExceptions)
{
sb.AppendLine(string.Format("{0}: {1}", exception.ToString(), exception.Message));
}
this.SetErrorMessage("Error on registering device: " + sb.ToString());
}
}
private void SetSuccessStatus(String statusMessage)
{
this.statusText.Text = statusMessage;
this.statusText.Foreground = new SolidColorBrush(Colors.Green);
}
private void SetErrorMessage(String errorMessage)
{
this.statusText.Text = errorMessage;
this.statusText.Foreground = new SolidColorBrush(Colors.Red);
}
private void OnUnregisterClick(object sender, RoutedEventArgs e)
{
try
{
var result = everliveApp.WorkWith().Push().CurrentDevice.Unregister().ExecuteSync(5000);
if (result)
{
this.SetSuccessStatus("Device unregistered successfully!");
this.IsDeviceRegistered = false;
this.IsSecondaryTileRegistered = false;
}
else
{
this.SetErrorMessage("Error on unregistering device!");
}
}
catch (Exception ex)
{
this.SetErrorMessage("Error on unregistering device! - ErrorMessage: " + ex.Message);
}
}
private void OnSendClick(object sender, RoutedEventArgs e)
{
PushNotification pushNotification = new PushNotification();
pushNotification.Message = this.pushNotificationMessage.Text;
// sends a toast notification with template "TextToast01"
var result = everliveApp.WorkWith().Push().Notifications().Create(pushNotification).ExecuteSync();
if (result.CreatedAt != null)
{
this.SetSuccessStatus("Message: \"" + pushNotification.Message + "\" sent!");
}
else
{
this.SetErrorMessage("Failed to send message: " + pushNotification.Message);
}
}
private async void OnPinSecondTileClick(object sender, RoutedEventArgs e)
{
Uri logo = new Uri("ms-appx:///Assets/tile_telerik_platform_150x150.png");
Uri smallLogo = new Uri("ms-appx:///Assets/tile_telerik_platform_50x50.png");
// During creation of secondary tile, an application may set additional arguments on the tile that will be passed in during activation.
// These arguments should be meaningful to the application. In this sample, we'll pass in the date and time the secondary tile was pinned.
string tileActivationArguments = MainPage.SecondaryTileId + " WasPinnedAt=" + DateTime.Now.ToLocalTime().ToString();
// Create a 1x1 Secondary tile
SecondaryTile secondaryTile = new SecondaryTile(MainPage.SecondaryTileId,
"SecondaryTile",
"Secondary Tile",
tileActivationArguments,
TileOptions.ShowNameOnLogo,
logo);
// Specify a foreground text value.
// The tile background color is inherited from the parent unless a separate value is specified.
secondaryTile.ForegroundText = ForegroundText.Light;
// Like the background color, the small tile logo is inherited from the parent application tile by default. Let's override it, just to see how that's done.
secondaryTile.SmallLogo = smallLogo;
// OK, the tile is created and we can now attempt to pin the tile.
// Note that the status message is updated when the async operation to pin the tile completes.
bool isPinned = await secondaryTile.RequestCreateForSelectionAsync(MainPage.GetElementRect((FrameworkElement)sender), Windows.UI.Popups.Placement.Below);
if (isPinned)
{
this.SetSuccessStatus("Secondary tile was successfully pinned.");
this.IsSecondaryTilePinned = true;
}
else
{
this.SetErrorMessage("Secondary tile is not pinned.");
}
}
private async void OnUnpinSecondTileClick(object sender, RoutedEventArgs e)
{
SecondaryTile secondaryTile = new SecondaryTile(MainPage.SecondaryTileId);
bool isUnpinned = await secondaryTile.RequestDeleteForSelectionAsync(MainPage.GetElementRect((FrameworkElement)sender), Windows.UI.Popups.Placement.Below);
if (isUnpinned)
{
this.SetSuccessStatus("Secondary tile was successfully unpinned.");
this.IsSecondaryTilePinned = false;
}
else
{
this.SetErrorMessage("Secondary tile is not unpinned.");
}
}
private void OnSendPushToSecondTileClick(object sender, RoutedEventArgs e)
{
// Windows: {
// "Tile": {
// "template": "TileSquare150x150PeekImageAndText01",
// "fallback": "TileSquarePeekImageAndText01"
// "text": ["WindowsPushSample", "Text2", "Text3", "Text4"],
// "image": [".\\Assets\\tile_telerik_platform_150x150.png"]
// },
// "SecondaryTileId": MainPage.SecondaryTileId
//}
JObject windows = new JObject();
JObject tile = new JObject();
tile["template"] = "TileSquarePeekImageAndText01";
tile["text"] = new JArray(new String[] { this.text1.Text, this.text2.Text, this.text3.Text, this.text4.Text});
tile["image"] = new JArray(new String[] { this.image1.Text });
windows["Tile"] = tile;
windows["SecondaryTileId"] = MainPage.SecondaryTileId;
PushNotification pushNotification = new PushNotification();
pushNotification.Windows = windows;
var result = everliveApp.WorkWith().Push().Notifications().Create(pushNotification).ExecuteSync(5000);
if (result.CreatedAt != null)
{
this.SetSuccessStatus("Successfully sent a secondary tile notification!");
}
else
{
this.SetErrorMessage("Failed to send a secondary tile notification!");
}
}
private void OnRegisterSecondTileClick(object sender, RoutedEventArgs e)
{
try
{
var result = everliveApp.WorkWith().Push().CurrentDevice
.UpdateRegistration(MainPage.SecondaryTileId)
.ExecuteSync(5000);
if (result)
{
this.SetSuccessStatus("SecondaryTile with Id: \"" + MainPage.SecondaryTileId + "\" registered successfully!");
this.IsSecondaryTileRegistered = true;
}
else
{
this.SetErrorMessage("Error on registering secondary tile!");
}
}
catch (EverliveException ex)
{
this.SetErrorMessage("Error on registering device: " + ex.Message);
}
}
// Gets the rectangle of the element
public static Rect GetElementRect(FrameworkElement element)
{
GeneralTransform buttonTransform = element.TransformToVisual(null);
Point point = buttonTransform.TransformPoint(new Point());
return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
}
private void OnUnregisterSecondTileClick(object sender, RoutedEventArgs e)
{
try
{
var result = everliveApp.WorkWith().Push().CurrentDevice
.UnregisterSecondaryTile(MainPage.SecondaryTileId)
.ExecuteSync(5000);
if (result)
{
this.SetSuccessStatus("Secondary tile unregistered successfully!");
this.IsSecondaryTileRegistered = false;
}
else
{
this.SetErrorMessage("Error on unregistering secondary tile!");
}
}
catch (Exception ex)
{
this.SetErrorMessage("Error on unregistering secondary tile! - ErrorMessage: " + ex.Message);
}
}
private async void CheckSecondaryTiles()
{
IReadOnlyList<SecondaryTile> tilelist = await Windows.UI.StartScreen.SecondaryTile.FindAllAsync();
if (tilelist.Count > 0)
{
this.IsSecondaryTilePinned = true;
}
else
{
this.IsSecondaryTilePinned = false;
}
}
private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
}
}
}

Просмотреть файл

@ -0,0 +1,366 @@
<?xml version="1.0" encoding="utf-8"?>
<StoreAssociation xmlns="http://schemas.microsoft.com/appx/2010/storeassociation">
<Publisher>CN=A6114CDA-C037-48BD-B8B6-9F8020555726</Publisher>
<NamespacePrefix>Telerik</NamespacePrefix>
<PublisherDisplayName>Telerik</PublisherDisplayName>
<GeneratePackageHash>http://www.w3.org/2001/04/xmlenc#sha256</GeneratePackageHash>
<SupportedLocales>
<Language Code="af" InMinimumRequirementSet="false" />
<Language Code="af-za" InMinimumRequirementSet="false" />
<Language Code="am" InMinimumRequirementSet="false" />
<Language Code="am-et" InMinimumRequirementSet="false" />
<Language Code="ar" InMinimumRequirementSet="true" />
<Language Code="ar-ae" InMinimumRequirementSet="true" />
<Language Code="ar-bh" InMinimumRequirementSet="true" />
<Language Code="ar-dz" InMinimumRequirementSet="true" />
<Language Code="ar-eg" InMinimumRequirementSet="true" />
<Language Code="ar-iq" InMinimumRequirementSet="true" />
<Language Code="ar-jo" InMinimumRequirementSet="true" />
<Language Code="ar-kw" InMinimumRequirementSet="true" />
<Language Code="ar-lb" InMinimumRequirementSet="true" />
<Language Code="ar-ly" InMinimumRequirementSet="true" />
<Language Code="ar-ma" InMinimumRequirementSet="true" />
<Language Code="ar-om" InMinimumRequirementSet="true" />
<Language Code="ar-qa" InMinimumRequirementSet="true" />
<Language Code="ar-sa" InMinimumRequirementSet="true" />
<Language Code="ar-sy" InMinimumRequirementSet="true" />
<Language Code="ar-tn" InMinimumRequirementSet="true" />
<Language Code="ar-ye" InMinimumRequirementSet="true" />
<Language Code="as" InMinimumRequirementSet="false" />
<Language Code="as-in" InMinimumRequirementSet="false" />
<Language Code="az-arab" InMinimumRequirementSet="false" />
<Language Code="az-arab-az" InMinimumRequirementSet="false" />
<Language Code="az-cyrl" InMinimumRequirementSet="false" />
<Language Code="az-cyrl-az" InMinimumRequirementSet="false" />
<Language Code="az-latn" InMinimumRequirementSet="false" />
<Language Code="az-latn-az" InMinimumRequirementSet="false" />
<Language Code="be" InMinimumRequirementSet="false" />
<Language Code="be-by" InMinimumRequirementSet="false" />
<Language Code="bg" InMinimumRequirementSet="true" />
<Language Code="bg-bg" InMinimumRequirementSet="true" />
<Language Code="bn" InMinimumRequirementSet="false" />
<Language Code="bn-bd" InMinimumRequirementSet="false" />
<Language Code="bn-in" InMinimumRequirementSet="false" />
<Language Code="bs" InMinimumRequirementSet="false" />
<Language Code="bs-cyrl" InMinimumRequirementSet="false" />
<Language Code="bs-cyrl-ba" InMinimumRequirementSet="false" />
<Language Code="bs-latn" InMinimumRequirementSet="false" />
<Language Code="bs-latn-ba" InMinimumRequirementSet="false" />
<Language Code="ca" InMinimumRequirementSet="false" />
<Language Code="ca-es" InMinimumRequirementSet="false" />
<Language Code="ca-es-valencia" InMinimumRequirementSet="false" />
<Language Code="chr-cher" InMinimumRequirementSet="false" />
<Language Code="chr-cher-us" InMinimumRequirementSet="false" />
<Language Code="chr-latn" InMinimumRequirementSet="false" />
<Language Code="cs" InMinimumRequirementSet="true" />
<Language Code="cs-cz" InMinimumRequirementSet="true" />
<Language Code="cy" InMinimumRequirementSet="false" />
<Language Code="cy-gb" InMinimumRequirementSet="false" />
<Language Code="da" InMinimumRequirementSet="true" />
<Language Code="da-dk" InMinimumRequirementSet="true" />
<Language Code="de" InMinimumRequirementSet="true" />
<Language Code="de-at" InMinimumRequirementSet="true" />
<Language Code="de-ch" InMinimumRequirementSet="true" />
<Language Code="de-de" InMinimumRequirementSet="true" />
<Language Code="de-li" InMinimumRequirementSet="true" />
<Language Code="de-lu" InMinimumRequirementSet="true" />
<Language Code="el" InMinimumRequirementSet="true" />
<Language Code="el-gr" InMinimumRequirementSet="true" />
<Language Code="en" InMinimumRequirementSet="true" />
<Language Code="en-011" InMinimumRequirementSet="true" />
<Language Code="en-014" InMinimumRequirementSet="true" />
<Language Code="en-018" InMinimumRequirementSet="true" />
<Language Code="en-021" InMinimumRequirementSet="true" />
<Language Code="en-029" InMinimumRequirementSet="true" />
<Language Code="en-053" InMinimumRequirementSet="true" />
<Language Code="en-au" InMinimumRequirementSet="true" />
<Language Code="en-bz" InMinimumRequirementSet="true" />
<Language Code="en-ca" InMinimumRequirementSet="true" />
<Language Code="en-gb" InMinimumRequirementSet="true" />
<Language Code="en-hk" InMinimumRequirementSet="true" />
<Language Code="en-id" InMinimumRequirementSet="true" />
<Language Code="en-ie" InMinimumRequirementSet="true" />
<Language Code="en-in" InMinimumRequirementSet="true" />
<Language Code="en-jm" InMinimumRequirementSet="true" />
<Language Code="en-kz" InMinimumRequirementSet="true" />
<Language Code="en-mt" InMinimumRequirementSet="true" />
<Language Code="en-my" InMinimumRequirementSet="true" />
<Language Code="en-nz" InMinimumRequirementSet="true" />
<Language Code="en-ph" InMinimumRequirementSet="true" />
<Language Code="en-pk" InMinimumRequirementSet="true" />
<Language Code="en-sg" InMinimumRequirementSet="true" />
<Language Code="en-tt" InMinimumRequirementSet="true" />
<Language Code="en-us" InMinimumRequirementSet="true" />
<Language Code="en-vn" InMinimumRequirementSet="true" />
<Language Code="en-za" InMinimumRequirementSet="true" />
<Language Code="es" InMinimumRequirementSet="true" />
<Language Code="es-019" InMinimumRequirementSet="true" />
<Language Code="es-419" InMinimumRequirementSet="true" />
<Language Code="es-ar" InMinimumRequirementSet="true" />
<Language Code="es-bo" InMinimumRequirementSet="true" />
<Language Code="es-cl" InMinimumRequirementSet="true" />
<Language Code="es-co" InMinimumRequirementSet="true" />
<Language Code="es-cr" InMinimumRequirementSet="true" />
<Language Code="es-do" InMinimumRequirementSet="true" />
<Language Code="es-ec" InMinimumRequirementSet="true" />
<Language Code="es-es" InMinimumRequirementSet="true" />
<Language Code="es-gt" InMinimumRequirementSet="true" />
<Language Code="es-hn" InMinimumRequirementSet="true" />
<Language Code="es-mx" InMinimumRequirementSet="true" />
<Language Code="es-ni" InMinimumRequirementSet="true" />
<Language Code="es-pa" InMinimumRequirementSet="true" />
<Language Code="es-pe" InMinimumRequirementSet="true" />
<Language Code="es-pr" InMinimumRequirementSet="true" />
<Language Code="es-py" InMinimumRequirementSet="true" />
<Language Code="es-sv" InMinimumRequirementSet="true" />
<Language Code="es-us" InMinimumRequirementSet="true" />
<Language Code="es-uy" InMinimumRequirementSet="true" />
<Language Code="es-ve" InMinimumRequirementSet="true" />
<Language Code="et" InMinimumRequirementSet="true" />
<Language Code="et-ee" InMinimumRequirementSet="true" />
<Language Code="eu" InMinimumRequirementSet="false" />
<Language Code="eu-es" InMinimumRequirementSet="false" />
<Language Code="fa" InMinimumRequirementSet="false" />
<Language Code="fa-ir" InMinimumRequirementSet="false" />
<Language Code="fi" InMinimumRequirementSet="true" />
<Language Code="fi-fi" InMinimumRequirementSet="true" />
<Language Code="fil" InMinimumRequirementSet="false" />
<Language Code="fil-latn" InMinimumRequirementSet="false" />
<Language Code="fil-ph" InMinimumRequirementSet="false" />
<Language Code="fr" InMinimumRequirementSet="true" />
<Language Code="fr-011" InMinimumRequirementSet="true" />
<Language Code="fr-015" InMinimumRequirementSet="true" />
<Language Code="fr-021" InMinimumRequirementSet="true" />
<Language Code="fr-029" InMinimumRequirementSet="true" />
<Language Code="fr-155" InMinimumRequirementSet="true" />
<Language Code="fr-be" InMinimumRequirementSet="true" />
<Language Code="fr-ca" InMinimumRequirementSet="true" />
<Language Code="fr-cd" InMinimumRequirementSet="true" />
<Language Code="fr-ch" InMinimumRequirementSet="true" />
<Language Code="fr-ci" InMinimumRequirementSet="true" />
<Language Code="fr-cm" InMinimumRequirementSet="true" />
<Language Code="fr-fr" InMinimumRequirementSet="true" />
<Language Code="fr-ht" InMinimumRequirementSet="true" />
<Language Code="fr-lu" InMinimumRequirementSet="true" />
<Language Code="fr-ma" InMinimumRequirementSet="true" />
<Language Code="fr-mc" InMinimumRequirementSet="true" />
<Language Code="fr-ml" InMinimumRequirementSet="true" />
<Language Code="fr-re" InMinimumRequirementSet="true" />
<Language Code="frc-latn" InMinimumRequirementSet="true" />
<Language Code="frp-latn" InMinimumRequirementSet="true" />
<Language Code="ga" InMinimumRequirementSet="false" />
<Language Code="ga-ie" InMinimumRequirementSet="false" />
<Language Code="gd-gb" InMinimumRequirementSet="false" />
<Language Code="gd-latn" InMinimumRequirementSet="false" />
<Language Code="gl" InMinimumRequirementSet="false" />
<Language Code="gl-es" InMinimumRequirementSet="false" />
<Language Code="gu" InMinimumRequirementSet="false" />
<Language Code="gu-in" InMinimumRequirementSet="false" />
<Language Code="ha-latn" InMinimumRequirementSet="false" />
<Language Code="ha-latn-ng" InMinimumRequirementSet="false" />
<Language Code="he" InMinimumRequirementSet="true" />
<Language Code="he-il" InMinimumRequirementSet="true" />
<Language Code="hi" InMinimumRequirementSet="true" />
<Language Code="hi-in" InMinimumRequirementSet="true" />
<Language Code="hr" InMinimumRequirementSet="true" />
<Language Code="hr-ba" InMinimumRequirementSet="true" />
<Language Code="hr-hr" InMinimumRequirementSet="true" />
<Language Code="hu" InMinimumRequirementSet="true" />
<Language Code="hu-hu" InMinimumRequirementSet="true" />
<Language Code="hy" InMinimumRequirementSet="false" />
<Language Code="hy-am" InMinimumRequirementSet="false" />
<Language Code="id" InMinimumRequirementSet="true" />
<Language Code="id-id" InMinimumRequirementSet="true" />
<Language Code="ig-latn" InMinimumRequirementSet="false" />
<Language Code="ig-ng" InMinimumRequirementSet="false" />
<Language Code="is" InMinimumRequirementSet="false" />
<Language Code="is-is" InMinimumRequirementSet="false" />
<Language Code="it" InMinimumRequirementSet="true" />
<Language Code="it-ch" InMinimumRequirementSet="true" />
<Language Code="it-it" InMinimumRequirementSet="true" />
<Language Code="iu-cans" InMinimumRequirementSet="false" />
<Language Code="iu-latn" InMinimumRequirementSet="false" />
<Language Code="iu-latn-ca" InMinimumRequirementSet="false" />
<Language Code="ja" InMinimumRequirementSet="true" />
<Language Code="ja-jp" InMinimumRequirementSet="true" />
<Language Code="ka" InMinimumRequirementSet="false" />
<Language Code="ka-ge" InMinimumRequirementSet="false" />
<Language Code="kk" InMinimumRequirementSet="false" />
<Language Code="kk-kz" InMinimumRequirementSet="false" />
<Language Code="km" InMinimumRequirementSet="false" />
<Language Code="km-kh" InMinimumRequirementSet="false" />
<Language Code="kn" InMinimumRequirementSet="false" />
<Language Code="kn-in" InMinimumRequirementSet="false" />
<Language Code="ko" InMinimumRequirementSet="true" />
<Language Code="ko-kr" InMinimumRequirementSet="true" />
<Language Code="kok" InMinimumRequirementSet="false" />
<Language Code="kok-in" InMinimumRequirementSet="false" />
<Language Code="ku-arab" InMinimumRequirementSet="false" />
<Language Code="ku-arab-iq" InMinimumRequirementSet="false" />
<Language Code="ky-cyrl" InMinimumRequirementSet="false" />
<Language Code="ky-kg" InMinimumRequirementSet="false" />
<Language Code="lb" InMinimumRequirementSet="false" />
<Language Code="lb-lu" InMinimumRequirementSet="false" />
<Language Code="lt" InMinimumRequirementSet="true" />
<Language Code="lt-lt" InMinimumRequirementSet="true" />
<Language Code="lv" InMinimumRequirementSet="true" />
<Language Code="lv-lv" InMinimumRequirementSet="true" />
<Language Code="mi" InMinimumRequirementSet="false" />
<Language Code="mi-latn" InMinimumRequirementSet="false" />
<Language Code="mi-nz" InMinimumRequirementSet="false" />
<Language Code="mk" InMinimumRequirementSet="false" />
<Language Code="mk-mk" InMinimumRequirementSet="false" />
<Language Code="ml" InMinimumRequirementSet="false" />
<Language Code="ml-in" InMinimumRequirementSet="false" />
<Language Code="mn-cyrl" InMinimumRequirementSet="false" />
<Language Code="mn-mn" InMinimumRequirementSet="false" />
<Language Code="mn-mong" InMinimumRequirementSet="false" />
<Language Code="mn-phag" InMinimumRequirementSet="false" />
<Language Code="mr" InMinimumRequirementSet="false" />
<Language Code="mr-in" InMinimumRequirementSet="false" />
<Language Code="ms" InMinimumRequirementSet="false" />
<Language Code="ms-bn" InMinimumRequirementSet="false" />
<Language Code="ms-my" InMinimumRequirementSet="false" />
<Language Code="mt" InMinimumRequirementSet="false" />
<Language Code="mt-mt" InMinimumRequirementSet="false" />
<Language Code="nb" InMinimumRequirementSet="true" />
<Language Code="nb-no" InMinimumRequirementSet="true" />
<Language Code="ne" InMinimumRequirementSet="false" />
<Language Code="ne-np" InMinimumRequirementSet="false" />
<Language Code="nl" InMinimumRequirementSet="true" />
<Language Code="nl-be" InMinimumRequirementSet="true" />
<Language Code="nl-nl" InMinimumRequirementSet="true" />
<Language Code="nn" InMinimumRequirementSet="false" />
<Language Code="nn-no" InMinimumRequirementSet="false" />
<Language Code="no" InMinimumRequirementSet="true" />
<Language Code="no-no" InMinimumRequirementSet="true" />
<Language Code="nso" InMinimumRequirementSet="false" />
<Language Code="nso-za" InMinimumRequirementSet="false" />
<Language Code="or" InMinimumRequirementSet="false" />
<Language Code="or-in" InMinimumRequirementSet="false" />
<Language Code="pa" InMinimumRequirementSet="false" />
<Language Code="pa-arab" InMinimumRequirementSet="false" />
<Language Code="pa-arab-pk" InMinimumRequirementSet="false" />
<Language Code="pa-deva" InMinimumRequirementSet="false" />
<Language Code="pa-in" InMinimumRequirementSet="false" />
<Language Code="pl" InMinimumRequirementSet="true" />
<Language Code="pl-pl" InMinimumRequirementSet="true" />
<Language Code="prs" InMinimumRequirementSet="false" />
<Language Code="prs-af" InMinimumRequirementSet="false" />
<Language Code="prs-arab" InMinimumRequirementSet="false" />
<Language Code="pt" InMinimumRequirementSet="true" />
<Language Code="pt-br" InMinimumRequirementSet="true" />
<Language Code="pt-pt" InMinimumRequirementSet="true" />
<Language Code="quc-latn" InMinimumRequirementSet="false" />
<Language Code="qut-gt" InMinimumRequirementSet="false" />
<Language Code="qut-latn" InMinimumRequirementSet="false" />
<Language Code="quz" InMinimumRequirementSet="false" />
<Language Code="quz-bo" InMinimumRequirementSet="false" />
<Language Code="quz-ec" InMinimumRequirementSet="false" />
<Language Code="quz-pe" InMinimumRequirementSet="false" />
<Language Code="ro" InMinimumRequirementSet="true" />
<Language Code="ro-ro" InMinimumRequirementSet="true" />
<Language Code="ru" InMinimumRequirementSet="true" />
<Language Code="ru-ru" InMinimumRequirementSet="true" />
<Language Code="rw" InMinimumRequirementSet="false" />
<Language Code="rw-rw" InMinimumRequirementSet="false" />
<Language Code="sd-arab" InMinimumRequirementSet="false" />
<Language Code="sd-arab-pk" InMinimumRequirementSet="false" />
<Language Code="sd-deva" InMinimumRequirementSet="false" />
<Language Code="si" InMinimumRequirementSet="false" />
<Language Code="si-lk" InMinimumRequirementSet="false" />
<Language Code="sk" InMinimumRequirementSet="true" />
<Language Code="sk-sk" InMinimumRequirementSet="true" />
<Language Code="sl" InMinimumRequirementSet="true" />
<Language Code="sl-si" InMinimumRequirementSet="true" />
<Language Code="sq" InMinimumRequirementSet="false" />
<Language Code="sq-al" InMinimumRequirementSet="false" />
<Language Code="sr-cyrl" InMinimumRequirementSet="false" />
<Language Code="sr-cyrl-ba" InMinimumRequirementSet="false" />
<Language Code="sr-cyrl-cs" InMinimumRequirementSet="false" />
<Language Code="sr-cyrl-me" InMinimumRequirementSet="false" />
<Language Code="sr-cyrl-rs" InMinimumRequirementSet="false" />
<Language Code="sr-latn" InMinimumRequirementSet="true" />
<Language Code="sr-latn-ba" InMinimumRequirementSet="true" />
<Language Code="sr-latn-cs" InMinimumRequirementSet="true" />
<Language Code="sr-latn-me" InMinimumRequirementSet="true" />
<Language Code="sr-latn-rs" InMinimumRequirementSet="true" />
<Language Code="sv" InMinimumRequirementSet="true" />
<Language Code="sv-fi" InMinimumRequirementSet="true" />
<Language Code="sv-se" InMinimumRequirementSet="true" />
<Language Code="sw" InMinimumRequirementSet="false" />
<Language Code="sw-ke" InMinimumRequirementSet="false" />
<Language Code="ta" InMinimumRequirementSet="false" />
<Language Code="ta-in" InMinimumRequirementSet="false" />
<Language Code="te" InMinimumRequirementSet="false" />
<Language Code="te-in" InMinimumRequirementSet="false" />
<Language Code="tg-arab" InMinimumRequirementSet="false" />
<Language Code="tg-cyrl" InMinimumRequirementSet="false" />
<Language Code="tg-cyrl-tj" InMinimumRequirementSet="false" />
<Language Code="tg-latn" InMinimumRequirementSet="false" />
<Language Code="th" InMinimumRequirementSet="true" />
<Language Code="th-th" InMinimumRequirementSet="true" />
<Language Code="ti" InMinimumRequirementSet="false" />
<Language Code="ti-et" InMinimumRequirementSet="false" />
<Language Code="tk-cyrl" InMinimumRequirementSet="false" />
<Language Code="tk-cyrl-tr" InMinimumRequirementSet="false" />
<Language Code="tk-latn" InMinimumRequirementSet="false" />
<Language Code="tk-latn-tr" InMinimumRequirementSet="false" />
<Language Code="tk-tm" InMinimumRequirementSet="false" />
<Language Code="tn" InMinimumRequirementSet="false" />
<Language Code="tn-bw" InMinimumRequirementSet="false" />
<Language Code="tn-za" InMinimumRequirementSet="false" />
<Language Code="tr" InMinimumRequirementSet="true" />
<Language Code="tr-tr" InMinimumRequirementSet="true" />
<Language Code="tt-arab" InMinimumRequirementSet="false" />
<Language Code="tt-cyrl" InMinimumRequirementSet="false" />
<Language Code="tt-latn" InMinimumRequirementSet="false" />
<Language Code="tt-ru" InMinimumRequirementSet="false" />
<Language Code="ug-arab" InMinimumRequirementSet="false" />
<Language Code="ug-cn" InMinimumRequirementSet="false" />
<Language Code="ug-cyrl" InMinimumRequirementSet="false" />
<Language Code="ug-latn" InMinimumRequirementSet="false" />
<Language Code="uk" InMinimumRequirementSet="true" />
<Language Code="uk-ua" InMinimumRequirementSet="true" />
<Language Code="ur" InMinimumRequirementSet="false" />
<Language Code="ur-pk" InMinimumRequirementSet="false" />
<Language Code="uz-cyrl" InMinimumRequirementSet="false" />
<Language Code="uz-latn" InMinimumRequirementSet="false" />
<Language Code="uz-latn-uz" InMinimumRequirementSet="false" />
<Language Code="vi" InMinimumRequirementSet="false" />
<Language Code="vi-vn" InMinimumRequirementSet="false" />
<Language Code="wo" InMinimumRequirementSet="false" />
<Language Code="wo-sn" InMinimumRequirementSet="false" />
<Language Code="xh" InMinimumRequirementSet="false" />
<Language Code="xh-za" InMinimumRequirementSet="false" />
<Language Code="yo-latn" InMinimumRequirementSet="false" />
<Language Code="yo-ng" InMinimumRequirementSet="false" />
<Language Code="zh-cn" InMinimumRequirementSet="true" />
<Language Code="zh-hans" InMinimumRequirementSet="true" />
<Language Code="zh-hans-cn" InMinimumRequirementSet="true" />
<Language Code="zh-hans-sg" InMinimumRequirementSet="true" />
<Language Code="zh-hant" InMinimumRequirementSet="true" />
<Language Code="zh-hant-hk" InMinimumRequirementSet="true" />
<Language Code="zh-hant-mo" InMinimumRequirementSet="true" />
<Language Code="zh-hant-tw" InMinimumRequirementSet="true" />
<Language Code="zh-hk" InMinimumRequirementSet="true" />
<Language Code="zh-tw" InMinimumRequirementSet="true" />
<Language Code="zu" InMinimumRequirementSet="false" />
<Language Code="zu-za" InMinimumRequirementSet="false" />
</SupportedLocales>
<ProductReservedInfo>
<MainPackageIdentityName>Telerik.Windows8PushApp</MainPackageIdentityName>
<ReservedNames>
<ReservedName>Windows8PushApp</ReservedName>
</ReservedNames>
</ProductReservedInfo>
<AccountPackageIdentityNames>
<MainPackageIdentityName>Telerik.AppMockbyTelerik</MainPackageIdentityName>
<MainPackageIdentityName>Telerik.Everlive</MainPackageIdentityName>
<MainPackageIdentityName>Telerik.TasksbyTelerik</MainPackageIdentityName>
<MainPackageIdentityName>Telerik.TelerikControlsExamplesHTML</MainPackageIdentityName>
<MainPackageIdentityName>Telerik.TelerikControlsExamplesXAML</MainPackageIdentityName>
<MainPackageIdentityName>Telerik.Twitterclient</MainPackageIdentityName>
</AccountPackageIdentityNames>
<PackageInfoList LandingUrl="https://appdev.microsoft.com:443/StorePortals/Developer/Catalog/ReleaseAnchor/d2cae9ff-f5aa-4c60-9457-5ca8ece2e6c2" />
</StoreAssociation>

35
Package.appxmanifest Normal file
Просмотреть файл

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
<Identity Name="Telerik.Windows8PushApp" Publisher="CN=A6114CDA-C037-48BD-B8B6-9F8020555726" Version="1.0.0.0" />
<Properties>
<DisplayName>Windows8PushApp</DisplayName>
<PublisherDisplayName>Telerik</PublisherDisplayName>
<Logo>Assets\tile_telerik_platform_50x50.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.2.1</OSMinVersion>
<OSMaxVersionTested>6.2.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="WindowsPushSample.App">
<VisualElements DisplayName="Windows Push Sample" Logo="Assets\tile_telerik_platform_150x150.png" SmallLogo="Assets\tile_telerik_platform_30x30.png" Description="WindowsPushSample" ForegroundText="light" BackgroundColor="#464646" ToastCapable="true">
<LockScreen Notification="badge" BadgeLogo="Assets\tile_telerik_platform_24x24.png" />
<DefaultTile ShowName="allLogos" />
<SplashScreen Image="Assets\tile_telerik_platform_620x300.png" />
</VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" StartPage="MainPage">
<BackgroundTasks>
<Task Type="pushNotification" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

Просмотреть файл

@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WindowsPushSample")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WindowsPushSample")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

Просмотреть файл

@ -1,4 +1,15 @@
backend-services-push-windows
=============================
Windows Push Sample
-------------------
Native push notifications sample for Windows.
In order to use Windows Push Sample (Native push notifications sample for Windows) with Telerik Backend Services you need to enable push notifications for Windows. This can be done by opening your Backend Services application from your Telerik Platform account and then open **Settings -> Push notifications** and choose Windows you should set Package Security ID and Client Secret of your Windows Store Dashboard. For more information you can refer to [this MSDN article](http://msdn.microsoft.com/en-us/library/windows/apps/hh913756.aspx).
> Note: That Package SID should be equal to the Package info of your device (desktop) app. For a windows store app this information is stored within "Package.appxmanifest" file. Visual studio provides an UI which helps in the process of editing it. The easiest way to connect your Windows Store Dashboard App to your desktop app is through Visual Studio menu **PROJECT -> Store -> Associate App With the Store ...** - then you should log into with your Windows Dev Center account credentials and select your application.
However for the sake of the example this application comes with a predefined package info (Windows8PushApp) owned by Telerik, so all you need is to set: "ms-app://s-1-15-2-3157833167-2319104520-3008724778-1960889256-2485977247-996848071-3039990472" as Package SID and "fIpx0SSm9Dbrnk4gmOkdjRCAGdrXiapc" as Client Secret within your Telerik Backend Services application.
> Be aware that this application should be used only for testing purposes and Telerik could disable this Windows Store Application at any time.
The upper segment is used to send a toast push notification with a sample text. Just click "Register" button and device will be automatically registered within Telerik Backend Services. Next step is to fill the "Toast Message" field and click "Send Push Notification" button. It will send a toast notification with a template "ToastText01" and "Toast Message" will be the entered text. For a complete set of toast templates you can refer to [this article](http://msdn.microsoft.com/en-us/library/windows/apps/hh761494.aspx).
The second segment of the application shows how to pin, register and send a push notification to a secondary tile.
The workflow is similar pin a secondary tile by pressing the "Pin Second Tile" button and approve the action. Then register it within Telerik Backend Services, fill all required fields as text1, text2, text3, text4 and image1 and click "Send Push Second Tile". It will send a tile notification (secondary tiles can accept only tile and badge notifications) with template "TileSquarePeekImageAndText01" which requires an image (.png 150 x 150 pxls) and 4 text fields (first one is bold and bigger). For a complete set of tile templates you can refer to [this article](http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx).

172
WindowsPushSample.csproj Normal file
Просмотреть файл

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{BA598480-61AD-4511-BCD8-7BDEBF92190E}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WindowsPushSample</RootNamespace>
<AssemblyName>WindowsPushSample</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="InverseBooleanConverter.cs" />
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Logo.png" />
<Content Include="Assets\SmallLogo.png" />
<Content Include="Assets\SplashScreen.png" />
<Content Include="Assets\SplashScreen.scale-100.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\tile_telerik_platform_150x150.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Assets\tile_telerik_platform_24x24.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Assets\tile_telerik_platform_30x30.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Assets\tile_telerik_platform_50x50.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Assets\tile_telerik_platform_620x300.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="Package.StoreAssociation.xml" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="Common\StandardStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>lib\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Telerik.Everlive.Sdk.WindowsStore">
<HintPath>lib\Telerik.Everlive.Sdk.WindowsStore.dll</HintPath>
</Reference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '11.0' ">
<VisualStudioVersion>11.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AppxShowAllApps>False</AppxShowAllApps>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>

Двоичные данные
lib/Newtonsoft.Json.dll Normal file

Двоичный файл не отображается.

Двоичные данные
lib/Telerik.Everlive.Sdk.WindowsStore.dll Normal file

Двоичный файл не отображается.

Двоичные данные
lib/Telerik.Everlive.Sdk.WindowsStore.pri Normal file

Двоичный файл не отображается.