@chat21/chat21-ionic 3.0.55 → 3.0.59-rc10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +4 -0
- package/config.xml +11 -2
- package/env.sample +2 -0
- package/package.json +1 -1
- package/resources/Android/splash/drawable-land-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-hdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-ldpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-mdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/resources/Android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/resources/Android/splash.png +0 -0
- package/src/app/app-routing.module.ts +21 -17
- package/src/app/app.component.html +6 -3
- package/src/app/app.component.ts +323 -185
- package/src/app/app.module.ts +16 -8
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +4 -4
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +8 -2
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +6 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +7 -2
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +48 -3
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +7 -6
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +20 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +39 -9
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +8 -144
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +14 -17
- package/src/app/components/authentication/login/login.component.html +2 -2
- package/src/app/components/authentication/login/login.component.ts +2 -1
- package/src/app/components/conversation-detail/bubble-my-message/bubble-my-message.component.ts +1 -1
- package/src/app/components/conversation-detail/bubble-others-message/bubble-others-message.component.ts +1 -1
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +17 -12
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.scss +12 -0
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +21 -5
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +3 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +22 -17
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -5
- package/src/app/components/ddp-header/ddp-header.component.html +1 -1
- package/src/app/components/ddp-header/ddp-header.component.ts +4 -2
- package/src/app/components/image-viewer/image-viewer.component.html +23 -0
- package/src/app/components/image-viewer/image-viewer.component.scss +107 -0
- package/src/app/components/image-viewer/image-viewer.component.spec.ts +24 -0
- package/src/app/components/image-viewer/image-viewer.component.ts +38 -0
- package/src/app/components/project-item/project-item.component.html +147 -0
- package/src/app/components/project-item/project-item.component.scss +669 -0
- package/src/app/components/project-item/project-item.component.spec.ts +24 -0
- package/src/app/components/project-item/project-item.component.ts +316 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.html +7 -0
- package/src/app/components/utils/avatar-profile/avatar-profile.component.ts +22 -5
- package/src/app/pages/authentication/login/login.page.ts +2 -2
- package/src/app/pages/conversation-detail/conversation-detail.page.html +5 -3
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +122 -30
- package/src/app/pages/conversations-list/conversations-list.page.html +40 -24
- package/src/app/pages/conversations-list/conversations-list.page.scss +146 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +87 -6
- package/src/app/pages/unassigned-conversations/unassigned-conversations-routing.module.ts +17 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.module.ts +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.html +22 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.scss +79 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.spec.ts +24 -0
- package/src/app/pages/unassigned-conversations/unassigned-conversations.page.ts +108 -0
- package/src/app/services/nav-proxy.service.ts +1 -1
- package/src/app/services/tiledesk/tiledesk.service.ts +22 -1
- package/src/app/services/websocket/websocket-js.ts +559 -0
- package/src/app/services/websocket/websocket.service.spec.ts +12 -0
- package/src/app/services/websocket/websocket.service.ts +274 -0
- package/src/app/shared/shared.module.ts +7 -1
- package/src/assets/i18n/en.json +9 -1
- package/src/assets/i18n/it.json +10 -2
- package/src/assets/js/chat21client.js +141 -67
- package/src/assets/transparent.png +0 -0
- package/src/chat-config-pre-test.json +4 -2
- package/src/chat-config-template.json +3 -1
- package/src/chat-config.json +3 -1
- package/src/chat21-core/providers/abstract/app-storage.service.ts +2 -2
- package/src/chat21-core/providers/chat-manager.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +125 -79
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +11 -17
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +2 -2
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +1 -1
- package/src/chat21-core/providers/localSessionStorage.ts +155 -154
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +27 -27
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +13 -5
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +101 -11
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +1 -1
- package/src/chat21-core/utils/utils.ts +1 -1
- package/src/global.scss +2 -7
- package/src/index.html +1 -1
|
@@ -33,6 +33,7 @@ import { LoggerService } from '../abstract/logger.service';
|
|
|
33
33
|
import { Observable, Observer, fromEvent, merge } from 'rxjs';
|
|
34
34
|
import { map } from 'rxjs/operators'
|
|
35
35
|
import { Network } from '@ionic-native/network/ngx';
|
|
36
|
+
|
|
36
37
|
// @Injectable({ providedIn: 'root' })
|
|
37
38
|
@Injectable()
|
|
38
39
|
export class FirebaseAuthService extends MessagingAuthService {
|
|
@@ -60,40 +61,58 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
60
61
|
|
|
61
62
|
status = 'ONLINE';
|
|
62
63
|
isConnected = true;
|
|
63
|
-
|
|
64
|
+
unsubscribe: any;
|
|
64
65
|
constructor(
|
|
65
66
|
public http: HttpClient,
|
|
66
67
|
private network: Network,
|
|
67
68
|
private connectionService: ConnectionService
|
|
68
69
|
) {
|
|
69
70
|
super();
|
|
71
|
+
// this.initialize()
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
*
|
|
74
76
|
*/
|
|
75
77
|
initialize() {
|
|
76
|
-
|
|
78
|
+
this.logger.log('initialize FROM [APP-COMP] [FIREBASEAuthSERVICE]')
|
|
77
79
|
this.SERVER_BASE_URL = this.getBaseUrl();
|
|
78
80
|
this.URL_TILEDESK_CREATE_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'chat21/firebase/auth/createCustomToken';
|
|
79
|
-
this.logger.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
this.logger.log('[FIREBASEAuthSERVICE] - initialize URL_TILEDESK_CREATE_CUSTOM_TOKEN ', this.URL_TILEDESK_CREATE_CUSTOM_TOKEN)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
let firebasePersistence;
|
|
85
|
+
// console.log('FB-AUTH firebasePersistence', this.getPersistence())
|
|
86
|
+
switch (this.getPersistence()) {
|
|
87
|
+
case 'SESSION': {
|
|
88
|
+
firebasePersistence = firebase.auth.Auth.Persistence.SESSION;
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
case 'LOCAL': {
|
|
92
|
+
firebasePersistence = firebase.auth.Auth.Persistence.LOCAL;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
case 'NONE': {
|
|
96
|
+
firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
default: {
|
|
100
|
+
firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
105
|
+
this.logger.log('[FIREBASEAuthSERVICE] firebasePersistence ', firebasePersistence)
|
|
106
|
+
// this.onAuthStateChanged(); // commented for new-login
|
|
107
|
+
})
|
|
108
|
+
.catch((error) => {
|
|
109
|
+
this.logger.error('[FIREBASEAuthSERVICE] Error: ', error);
|
|
110
|
+
});
|
|
111
|
+
|
|
92
112
|
|
|
93
|
-
this.onAuthStateChanged();
|
|
94
113
|
}
|
|
95
114
|
|
|
96
|
-
checkInternetConnection
|
|
115
|
+
checkInternetConnection() {
|
|
97
116
|
this.logger.log('[FIREBASEAuthSERVICE] - checkInternetConnection');
|
|
98
117
|
// let connectSubscription = this.network.onConnect().subscribe(() => {
|
|
99
118
|
// this.logger.log('[FIREBASEAuthSERVICE] - network connected!');
|
|
@@ -107,28 +126,28 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
107
126
|
// }, 3000);
|
|
108
127
|
// });
|
|
109
128
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
|
|
130
|
+
// this.connectionService.monitor().subscribe(isConnected => {
|
|
131
|
+
// this.isConnected = isConnected;
|
|
132
|
+
// this.logger.log('[FIREBASEAuthSERVICE] - checkInternetConnection isConnected', isConnected);
|
|
133
|
+
// if (this.isConnected) {
|
|
134
|
+
// this.status = "ONLINE";
|
|
135
|
+
|
|
136
|
+
// // this.onAuthStateChanged();
|
|
137
|
+
// firebase.auth().onAuthStateChanged(user => {
|
|
138
|
+
// this.logger.log('[FIREBASEAuthSERVICE] checkInternetConnection onAuthStateChanged', user)
|
|
139
|
+
// })
|
|
140
|
+
// }
|
|
141
|
+
// else {
|
|
142
|
+
// this.status = "OFFLINE";
|
|
143
|
+
// // this.onAuthStateChanged();
|
|
144
|
+
// firebase.auth().onAuthStateChanged(user => {
|
|
145
|
+
// this.logger.log('[FIREBASEAuthSERVICE] checkInternetConnection onAuthStateChanged', user)
|
|
146
|
+
// })
|
|
147
|
+
// }
|
|
148
|
+
// })
|
|
149
|
+
|
|
150
|
+
|
|
132
151
|
}
|
|
133
152
|
|
|
134
153
|
// createOnline$() {
|
|
@@ -178,60 +197,42 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
178
197
|
*/
|
|
179
198
|
onAuthStateChanged() {
|
|
180
199
|
const that = this;
|
|
181
|
-
|
|
200
|
+
|
|
201
|
+
// ---------------------------------------------------------------------------------------------------
|
|
202
|
+
// Protecting from multiple subsciptions due to multiple app initializations (call to initializeApp())
|
|
203
|
+
// Only one subscriber x application allowed
|
|
204
|
+
// ---------------------------------------------------------------------------------------------------
|
|
205
|
+
if (this.unsubscribe) {
|
|
206
|
+
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged ALREADY SUBSCRIBED')
|
|
207
|
+
return
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
this.unsubscribe = firebase.auth().onAuthStateChanged(user => {
|
|
182
211
|
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged', user)
|
|
212
|
+
|
|
213
|
+
|
|
183
214
|
if (!user) {
|
|
184
215
|
this.logger.log('[FIREBASEAuthSERVICE] 1 - PASSO OFFLINE AL CHAT MANAGER')
|
|
185
216
|
// this.logger.info('initialize FROM [APP-COMP] - [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged user ', user)
|
|
186
|
-
|
|
217
|
+
|
|
187
218
|
that.BSAuthStateChanged.next('offline');
|
|
219
|
+
// console.log('initialize FROM [APP-COMP] that.BSAuthStateChanged ', that.BSAuthStateChanged)
|
|
188
220
|
} else {
|
|
189
221
|
this.logger.log('[FIREBASEAuthSERVICE] 2 - PASSO ONLINE AL CHAT MANAGER')
|
|
190
222
|
// this.logger.info('initialize FROM [APP-COMP] - [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged user ', user)
|
|
191
223
|
that.BSAuthStateChanged.next('online');
|
|
192
224
|
}
|
|
193
|
-
}
|
|
194
|
-
|
|
225
|
+
}, error => {
|
|
226
|
+
this.logger.error('initialize FROM [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged * error * ', error)
|
|
227
|
+
}, () => {
|
|
228
|
+
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEAuthSERVICE] onAuthStateChanged *** complete *** ');
|
|
195
229
|
|
|
196
|
-
/**
|
|
197
|
-
* FIREBASE: signInWithCustomToken
|
|
198
|
-
* @param token
|
|
199
|
-
*/
|
|
200
|
-
signInFirebaseWithCustomToken(token: string): Promise<any> {
|
|
201
|
-
const that = this;
|
|
202
|
-
let firebasePersistence;
|
|
203
|
-
// console.log('FB-AUTH firebasePersistence', this.getPersistence())
|
|
204
|
-
switch (this.getPersistence()) {
|
|
205
|
-
case 'SESSION': {
|
|
206
|
-
firebasePersistence = firebase.auth.Auth.Persistence.SESSION;
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
case 'LOCAL': {
|
|
210
|
-
firebasePersistence = firebase.auth.Auth.Persistence.LOCAL;
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
case 'NONE': {
|
|
214
|
-
firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
default: {
|
|
218
|
-
firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
219
|
-
break;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
223
|
-
return firebase.auth().signInWithCustomToken(token).then(async (user) => {
|
|
224
|
-
|
|
225
|
-
// that.firebaseSignInWithCustomToken.next(response);
|
|
226
|
-
}).catch((error) => {
|
|
227
|
-
that.logger.error('[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ', error);
|
|
228
|
-
// that.firebaseSignInWithCustomToken.next(null);
|
|
229
|
-
});
|
|
230
|
-
}).catch((error) => {
|
|
231
|
-
that.logger.error('[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ', error);
|
|
232
230
|
});
|
|
231
|
+
|
|
232
|
+
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
+
|
|
235
236
|
/**
|
|
236
237
|
* FIREBASE: createUserWithEmailAndPassword
|
|
237
238
|
* @param email
|
|
@@ -275,6 +276,8 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
275
276
|
// cancello token
|
|
276
277
|
// this.appStorage.removeItem('tiledeskToken');
|
|
277
278
|
//localStorage.removeItem('firebaseToken');
|
|
279
|
+
|
|
280
|
+
|
|
278
281
|
that.BSSignOut.next(true);
|
|
279
282
|
}).catch((error) => {
|
|
280
283
|
that.logger.error('[FIREBASEAuthSERVICE] signOut error: ', error);
|
|
@@ -319,12 +322,55 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
319
322
|
});
|
|
320
323
|
}
|
|
321
324
|
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* FIREBASE: signInWithCustomToken
|
|
328
|
+
* @param token
|
|
329
|
+
*/
|
|
330
|
+
signInFirebaseWithCustomToken(token: string): Promise<any> {
|
|
331
|
+
// const that = this;
|
|
332
|
+
// let firebasePersistence;
|
|
333
|
+
// // console.log('FB-AUTH firebasePersistence', this.getPersistence())
|
|
334
|
+
// switch (this.getPersistence()) {
|
|
335
|
+
// case 'SESSION': {
|
|
336
|
+
// firebasePersistence = firebase.auth.Auth.Persistence.SESSION;
|
|
337
|
+
// break;
|
|
338
|
+
// }
|
|
339
|
+
// case 'LOCAL': {
|
|
340
|
+
// firebasePersistence = firebase.auth.Auth.Persistence.LOCAL;
|
|
341
|
+
// break;
|
|
342
|
+
// }
|
|
343
|
+
// case 'NONE': {
|
|
344
|
+
// firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
345
|
+
// break;
|
|
346
|
+
// }
|
|
347
|
+
// default: {
|
|
348
|
+
// firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
349
|
+
// break;
|
|
350
|
+
// }
|
|
351
|
+
// }
|
|
352
|
+
// return firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
353
|
+
return firebase.auth().signInWithCustomToken(token).then(async (user) => {
|
|
354
|
+
this.logger.log('[FIREBASEAuthSERVICE] signInWithCustomToken user: ', user);
|
|
355
|
+
if (user) {
|
|
356
|
+
this.BSAuthStateChanged.next('online');
|
|
357
|
+
}
|
|
358
|
+
// that.firebaseSignInWithCustomToken.next(response);
|
|
359
|
+
}).catch((error) => {
|
|
360
|
+
this.logger.error('[FIREBASEAuthSERVICE] signInWithCustomToken Error: ', error);
|
|
361
|
+
// that.firebaseSignInWithCustomToken.next(null);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
322
365
|
logout() {
|
|
323
366
|
this.logger.log('[FIREBASEAuthSERVICE] logout');
|
|
324
367
|
this.BSAuthStateChanged.next(null);
|
|
368
|
+
|
|
325
369
|
// cancello token firebase dal local storage e da firebase
|
|
326
370
|
// dovrebbe scattare l'evento authchangeStat
|
|
371
|
+
this.BSAuthStateChanged.next('offline');
|
|
327
372
|
this.signOut();
|
|
373
|
+
// this.unsubscribe();
|
|
328
374
|
}
|
|
329
375
|
|
|
330
376
|
}
|
|
@@ -65,7 +65,7 @@ export class FirebaseConversationHandler extends ConversationHandlerService {
|
|
|
65
65
|
* inizializzo conversation handler
|
|
66
66
|
*/
|
|
67
67
|
initialize(recipientId: string,recipientFullName: string,loggedUser: UserModel,tenant: string,translationMap: Map<string, string>) {
|
|
68
|
-
this.logger.
|
|
68
|
+
this.logger.log('[FIREBASEConversationHandlerSERVICE] initWithRecipient',recipientId, recipientFullName, loggedUser, tenant, translationMap)
|
|
69
69
|
this.recipientId = recipientId;
|
|
70
70
|
this.recipientFullname = recipientFullName;
|
|
71
71
|
this.loggedUser = loggedUser;
|
|
@@ -26,7 +26,7 @@ export class FirebaseNotifications extends NotificationsService {
|
|
|
26
26
|
initialize(tenant: string, vapId: string): void {
|
|
27
27
|
this.tenant = tenant
|
|
28
28
|
this.vapidkey = vapId
|
|
29
|
-
this.logger.
|
|
29
|
+
this.logger.log('[FIREBASE-NOTIFICATIONS] initialize - tenant ', this.tenant)
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
if (!('serviceWorker' in navigator)) {
|
|
@@ -157,21 +157,16 @@ export class FirebaseNotifications extends NotificationsService {
|
|
|
157
157
|
|
|
158
158
|
removeNotificationsInstance(callback: (string) => void) {
|
|
159
159
|
var self = this;
|
|
160
|
-
firebase.auth().onAuthStateChanged(function (user) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
} else {
|
|
171
|
-
self.logger.debug('[FIREBASE-NOTIFICATIONS] - No FB user is signed in. ', user)
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
160
|
+
// firebase.auth().onAuthStateChanged(function (user) {
|
|
161
|
+
// if (user) {
|
|
162
|
+
// self.logger.debug('[FIREBASE-NOTIFICATIONS] - FB User is signed in. ', user)
|
|
163
|
+
// self.logger.log('[FIREBASE-NOTIFICATIONS] >>>> removeNotificationsInstance > this.userId', self.userId);
|
|
164
|
+
// self.logger.log('[FIREBASE-NOTIFICATIONS] >>>> removeNotificationsInstance > FCMcurrentToken', self.FCMcurrentToken);
|
|
165
|
+
// // this.logger.log('[FIREBASE-NOTIFICATIONS] >>>> removeNotificationsInstance > this.tenant', this.tenant);
|
|
166
|
+
// } else {
|
|
167
|
+
// self.logger.debug('[FIREBASE-NOTIFICATIONS] - No FB user is signed in. ', user)
|
|
168
|
+
// }
|
|
169
|
+
// });
|
|
175
170
|
const urlNodeFirebase = '/apps/' + self.tenant
|
|
176
171
|
const connectionsRefinstancesId = urlNodeFirebase + '/users/' + self.userId + '/instances/'
|
|
177
172
|
self.logger.log('[FIREBASE-NOTIFICATIONS] >>>> connectionsRefinstancesId ', connectionsRefinstancesId);
|
|
@@ -194,7 +189,6 @@ export class FirebaseNotifications extends NotificationsService {
|
|
|
194
189
|
})
|
|
195
190
|
}
|
|
196
191
|
|
|
197
|
-
|
|
198
192
|
}
|
|
199
193
|
|
|
200
194
|
// removeNotificationsInstance() {
|
|
@@ -49,7 +49,7 @@ export class FirebasePresenceService extends PresenceService {
|
|
|
49
49
|
public initialize(tenant: string) {
|
|
50
50
|
// this.tenant = this.getTenant();
|
|
51
51
|
this.tenant = tenant;
|
|
52
|
-
this.logger.
|
|
52
|
+
this.logger.log('[FIREBASEPresenceSERVICE] initialize this.tenant', this.tenant);
|
|
53
53
|
this.urlNodePresence = '/apps/' + this.tenant + '/presence/';
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -129,7 +129,7 @@ export class FirebasePresenceService extends PresenceService {
|
|
|
129
129
|
* @param userid
|
|
130
130
|
*/
|
|
131
131
|
public setPresence(userid: string): void {
|
|
132
|
-
this.logger.
|
|
132
|
+
this.logger.log('initialize FROM [APP-COMP] - [FIREBASEPresenceSERVICE] - SET PRESENCE userid ', userid)
|
|
133
133
|
this.onlineConnectionsRef = this.referenceOnlineForUser(userid);
|
|
134
134
|
this.lastOnlineConnectionsRef = this.referenceLastOnlineForUser(userid);
|
|
135
135
|
const connectedRefURL = '/.info/connected';
|
|
@@ -52,7 +52,7 @@ export class FirebaseTypingService extends TypingService {
|
|
|
52
52
|
public initialize(tenant: string) {
|
|
53
53
|
// this.tenant = this.getTenant();
|
|
54
54
|
this.tenant = tenant;
|
|
55
|
-
this.logger.
|
|
55
|
+
this.logger.log('[FIREBASETypingSERVICE] initialize - tenant ', this.tenant)
|
|
56
56
|
this.urlNodeTypings = '/apps/' + this.tenant + '/typings/';
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -43,7 +43,7 @@ export class FirebaseUploadService extends UploadService {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
public initialize() {
|
|
46
|
-
this.logger.
|
|
46
|
+
this.logger.log('[FIREBASEUploadSERVICE] initialize');
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
public upload(userId: string, upload: UploadModel): Promise<any> {
|