Example #1
0
        /// <summary>
        /// API to subscribe to push notifications
        /// </summary>
        /// <param name="deviceid"></param>
        /// <param name="subscriptionType"></param>
        /// <param name="subscriptionUrl"></param>
        public void SubscribeToNotification(string deviceid, DAL.SubscriptionType subscriptionType, string subscriptionUrl)
        {
            DAL.User user = this.GetAuthenticatedUser();

            if (user == null)
            {
                throw new Exception("User not authenticated");
            }

            DAL.Subscription subscription = DAL.Subscription.UpdateOrInsertSubscription(deviceid, subscriptionType, subscriptionUrl, user.Id);
        }