コード例 #1
0
        /// <summary>
        /// On subscription change, reset the subscriber tile counter if exist.
        /// </summary>
        protected override void OnSubscribed(SubscriptionEventArgs e)
        {
            // Create a tile message to reset tile count.
            var tileMsg = new TilePushNotificationMessage(MessageSendPriority.High)
            {
                Count = 0,
                BackgroundImageUri = BackgroundImageUri,
                Title = Title
            };

            tileMsg.SendAsync(e.Subscription.ChannelUri, Log, Log);

            ResetCounter(e.Subscription.UserName);
        }
コード例 #2
0
        /// <summary>
        /// Once an application is activated again (the client side phone application
        /// has subscription logic on startup), try to update the tile again.
        /// In case that the application is not pinned, send raw notification message
        /// to the client, asking to pin the application. This raw notification message
        /// has to be well-known and handled by the client side phone application.
        /// In our case the raw message is AskToPin.
        /// </summary>
        protected override void OnSubscribed(SubscriptionEventArgs args)
        {
            // Asynchronously try to send Tile message to the relevant subscriber
            // with data already sent before so the tile won't change.
            var tileMsg = GetOrCreateMessage(args.Subscription.UserName, false);

            tileMsg.SendAsync(
                args.Subscription.ChannelUri,
                result =>
                {
                    Log(result);
                    OnMessageSent(args.Subscription.UserName, result);
                },
                Log);
        }
コード例 #3
0
 private void PushService_Subscribed(object sender, SubscriptionEventArgs args)
 {
     OnSubscribed(args);
 }
コード例 #4
0
 /// <summary>
 /// Override this to add logic when clients login.
 /// </summary>
 protected virtual void OnSubscribed(SubscriptionEventArgs args)
 {
 }
コード例 #5
0
 private void OnSubscribed(SubscriptionEventArgs args)
 {
     if (Subscribed != null)
     {
         Subscribed(this, args);
     }
 }