()
| 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([ |
no test coverage detected