Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5312ac7

Browse files
committed
CU-8687aj3gt Trying to fix User Push reg issue.
1 parent2da2fb9 commit5312ac7

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

‎Core/Resgrid.Model/PushUri.cs‎

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ namespace Resgrid.Model
1212
[Table("PushUris")]
1313
publicclassPushUri:IEntity
1414
{
15-
privatestring_pushLocation;
16-
1715
[Key]
1816
[Required]
1917
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
@@ -36,20 +34,8 @@ public class PushUri : IEntity
3634
publicstringDeviceId{get;set;}
3735

3836
[Required]
39-
publicstringPushLocation
40-
{
41-
get{return_pushLocation;}
42-
set
43-
{
44-
if(_pushLocation!=value)
45-
{
46-
_pushLocation=value;
47-
48-
//if (((Platforms)PlatformType) == Platforms.Windows8 || ((Platforms)PlatformType) == Platforms.WindowsPhone7 || ((Platforms)PlatformType) == Platforms.WindowsPhone8 || ((Platforms)PlatformType) == Platforms.UnitWin)
49-
//ChannelUri = new Uri(_pushLocation, UriKind.Absolute);
50-
}
51-
}
52-
}
37+
[ProtoMember(9)]
38+
publicstringPushLocation{get;set;}
5339

5440
[ProtoMember(5)]
5541
publicint?UnitId{get;set;}

‎Core/Resgrid.Services/PushService.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public PushService(IPushLogsService pushLogsService, INotificationProvider notif
3535

3636
publicasyncTask<bool>Register(PushUripushUri)
3737
{
38-
if(pushUri==null||String.IsNullOrWhiteSpace(pushUri.DeviceId))
38+
if(pushUri==null||String.IsNullOrWhiteSpace(pushUri.DeviceId)||string.IsNullOrWhiteSpace(pushUri.PushLocation))
3939
returnfalse;
4040

4141
varcode=pushUri.PushLocation;

‎Web/Resgrid.Web.Services/Controllers/v4/DevicesController.cs‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,13 @@ public async Task<ActionResult<PushRegistrationResult>> RegisterDevice([FromBody
154154
push.UserId=UserId;
155155
push.PlatformType=registrationInput.Platform;
156156

157-
vardepartment=await_departmentsService.GetDepartmentByIdAsync(DepartmentId,false);
158-
push.PushLocation=department.Code;
157+
if(!string.IsNullOrWhiteSpace(registrationInput.Prefix))
158+
push.PushLocation=registrationInput.Prefix;
159+
else
160+
{
161+
vardepartment=await_departmentsService.GetDepartmentByIdAsync(DepartmentId,false);
162+
push.PushLocation=department.Code;
163+
}
159164

160165
push.DeviceId=registrationInput.Token;
161166
push.Uuid=registrationInput.DeviceUuid;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp