MCPcopy Create free account
hub / github.com/CommE2E/comm / ensurePushNotifsEnabled

Method ensurePushNotifsEnabled

native/push/push-handler.react.js:490–512  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

488 }
489
490 async ensurePushNotifsEnabled() {
491 if (!this.props.loggedIn) {
492 return;
493 }
494 if (Platform.OS === 'android') {
495 await this.ensureAndroidPushNotifsEnabled();
496 return;
497 }
498 if (Platform.OS !== 'ios') {
499 return;
500 }
501 let missingDeviceToken = !this.props.localToken;
502 if (!missingDeviceToken) {
503 for (const keyserverID in this.props.deviceTokens) {
504 const deviceToken = this.props.deviceTokens[keyserverID];
505 if (deviceToken === null || deviceToken === undefined) {
506 missingDeviceToken = true;
507 break;
508 }
509 }
510 }
511 await requestIOSPushPermissions(missingDeviceToken);
512 }
513
514 async ensureAndroidPushNotifsEnabled() {
515 const permissionPromisesResult = await Promise.all([

Callers 2

onForegroundMethod · 0.95
componentDidUpdateMethod · 0.95

Calls 2

Tested by

no test coverage detected