示例#1
0
        public void AddMobileDevice(MobileDevice dv)
        {
            if (HasDeviceRegistered(dv.InstallationId))
            {
                return;
            }

            UsesDevices.Add(new MobileDeviceForUser(this, dv));
        }
示例#2
0
 public bool HasDeviceRegistered(string installationId)
 {
     return(UsesDevices.Any(d => d.MobileDevice.InstallationId == installationId));
 }
示例#3
0
 public MobileDevice GetMobileDevice(string installationId)
 {
     return(UsesDevices.Where(ud => ud.MobileDevice.InstallationId == installationId)
            .Select(ud => ud.MobileDevice).FirstOrDefault());
 }
示例#4
0
 public void InvalidatePushTokensForDevice(string installationId)
 {
     UsesDevices.SingleOrDefault(d => d.MobileDevice.InstallationId == installationId)
     ?.MobileDevice.InvalidateRegisteredPushTokens();
 }