Esempio n. 1
0
        /// <summary>
        /// When a user logs in, record their UserId and ChannelId so that they are associated.
        /// This lets us identify the channel to send the push notification to a specific user.
        /// </summary>
        /// <returns></returns>
        public async Task LoginUser()
        {
            // Get the channelId
            var channels = await client.GetTable <Channel>()
                           .Where(item => item.channelUri == channel.Uri)
                           .ToListAsync();

            UserChannel userChannel = new UserChannel
            {
                ChannelId = channels[0].id,
                UserKey   = userInfo.id
            };
            await client.GetTable <UserChannel>().InsertAsync(userChannel);
        }
        /// <summary>
        /// When a user logs in, record their UserId and ChannelId so that they are associated.
        /// This lets us identify the channel to send the push notification to a specific user.
        /// </summary>
        /// <returns></returns>
        public async Task LoginUser()
        {
            // Get the channelId
            var channels = await client.GetTable<Channel>()
                .Where(item => item.channelUri == channel.Uri)
                .ToListAsync();

            UserChannel userChannel = new UserChannel
            {
                ChannelId = channels[0].id,
                UserKey = userInfo.id
            };
            await client.GetTable<UserChannel>().InsertAsync(userChannel);
        }