[FIX] App hang on "updating" (#997)
* [FIX] App hang on "updating" * Fix iOS notification tap
This commit is contained in:
parent
b12c14fb78
commit
e2f9241040
|
@ -15,7 +15,7 @@ let disconnectedListener;
|
||||||
let streamListener;
|
let streamListener;
|
||||||
let subServer;
|
let subServer;
|
||||||
|
|
||||||
export default async function subscribeRooms() {
|
export default function subscribeRooms() {
|
||||||
let timer = null;
|
let timer = null;
|
||||||
const loop = () => {
|
const loop = () => {
|
||||||
if (timer) {
|
if (timer) {
|
||||||
|
@ -156,12 +156,13 @@ export default async function subscribeRooms() {
|
||||||
try {
|
try {
|
||||||
// set the server that started this task
|
// set the server that started this task
|
||||||
subServer = this.sdk.client.host;
|
subServer = this.sdk.client.host;
|
||||||
await this.sdk.subscribeNotifyUser();
|
this.sdk.subscribeNotifyUser().catch(e => console.log(e));
|
||||||
} catch (e) {
|
|
||||||
log('err_subscribe_rooms', e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stop: () => stop()
|
stop: () => stop()
|
||||||
};
|
};
|
||||||
|
} catch (e) {
|
||||||
|
log('err_subscribe_rooms', e);
|
||||||
|
return Promise.reject();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,13 @@ class PushNotification {
|
||||||
NotificationsIOS.setBadgesCount(count);
|
NotificationsIOS.setBadgesCount(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
configure(params) {
|
async configure(params) {
|
||||||
this.onRegister = params.onRegister;
|
this.onRegister = params.onRegister;
|
||||||
this.onNotification = params.onNotification;
|
this.onNotification = params.onNotification;
|
||||||
|
|
||||||
|
const initial = await NotificationsIOS.getInitialNotification();
|
||||||
NotificationsIOS.consumeBackgroundQueue();
|
NotificationsIOS.consumeBackgroundQueue();
|
||||||
return Promise.resolve();
|
return Promise.resolve(initial);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default new PushNotification();
|
export default new PushNotification();
|
||||||
|
|
Loading…
Reference in New Issue