Skip to content
Snippets Groups Projects
Commit 5639b78c authored by syuilo's avatar syuilo
Browse files

Fix bug

parent b44c7e9a
No related branches found
No related tags found
No related merge requests found
......@@ -257,8 +257,14 @@ export default class MiOS extends EventEmitter {
});
}).then(() => {
this.logInfo('[sw] Server Stored Subscription.');
}).catch(err => {
}).catch(async (err) => {
this.logError('[sw] Subscribe Error:', err);
// 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが
// 既に存在していることが原因でエラーになった可能性があるので、
// そのサブスクリプションを解除しておく
const subscription = await this.swRegistration.pushManager.getSubscription();
if (subscription) subscription.unsubscribe();
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment