Skip to content

Commit b76fb25

Browse files
authored
Merge pull request #3344 from numbersprotocol/fix-ios-google-login
fix(auth): Hide Google login on iOS Hide Google login button on iOS platforms in both login and signup pages to prevent App Store rejection when Apple login is not implemented.
2 parents a1a7e79 + 66d694c commit b76fb25

File tree

6 files changed

+17
-2
lines changed

6 files changed

+17
-2
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ npx cap open ios # Open in Xcode
104104
- Implement offline support with local database sync
105105
- Optimize performance with lazy loading and asset optimization
106106
- Follow mobile-first responsive design principles
107+
- **Platform Detection**: Use `Platform.is('ios')` from `@ionic/angular` instead of `Capacitor.getPlatform() === 'ios'` for better Ionic integration and consistency
107108

108109
## Configuration Files
109110

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,6 @@ npx cap open ios # Open project in Xcode
146146
- Use Visual Studio Code with Prettier extension
147147
- Run `npm run lint` before commits
148148
- Maintain comprehensive test coverage
149+
- **Platform Detection**: Use `Platform.is('ios')` from `@ionic/angular` instead of `Capacitor.getPlatform() === 'ios'` for better Ionic integration and consistency
149150

150151
This mobile application combines modern web technologies with native mobile capabilities to create a content authenticity and blockchain integration platform.

src/app/features/login/login.page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</form>
1515

1616
<app-social-login-button
17+
*ngIf="!isIOS"
1718
[buttonText]="t('continueWithGoogle')"
1819
></app-social-login-button>
1920

src/app/features/login/login.page.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component } from '@angular/core';
33
import { UntypedFormGroup } from '@angular/forms';
44
import { MatSnackBar } from '@angular/material/snack-bar';
55
import { ActivatedRoute, Router } from '@angular/router';
6-
import { AlertController } from '@ionic/angular';
6+
import { AlertController, Platform } from '@ionic/angular';
77
import { TranslocoService } from '@ngneat/transloco';
88
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
99
import { FormlyFieldConfig } from '@ngx-formly/core';
@@ -37,6 +37,10 @@ export class LoginPage {
3737

3838
showResendEmailButton = false;
3939

40+
get isIOS(): boolean {
41+
return this.platform.is('ios');
42+
}
43+
4044
constructor(
4145
private readonly blockingActionService: BlockingActionService,
4246
private readonly diaBackendAuthService: DiaBackendAuthService,
@@ -45,6 +49,7 @@ export class LoginPage {
4549
private readonly snackbar: MatSnackBar,
4650
private readonly onboardingService: OnboardingService,
4751
private readonly errorService: ErrorService,
52+
private readonly platform: Platform,
4853
private readonly route: ActivatedRoute,
4954
private readonly alertController: AlertController
5055
) {

src/app/features/signup/signup.page.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</form>
1919

2020
<app-social-login-button
21+
*ngIf="!isIOS"
2122
[buttonText]="t('continueWithGoogle')"
2223
></app-social-login-button>
2324

src/app/features/signup/signup.page.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http';
22
import { Component } from '@angular/core';
33
import { UntypedFormGroup } from '@angular/forms';
44
import { Router } from '@angular/router';
5+
import { Platform } from '@ionic/angular';
56
import { TranslocoService } from '@ngneat/transloco';
67
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
78
import { FormlyFieldConfig } from '@ngx-formly/core';
@@ -31,12 +32,17 @@ export class SignupPage {
3132

3233
fields: FormlyFieldConfig[] = [];
3334

35+
get isIOS(): boolean {
36+
return this.platform.is('ios');
37+
}
38+
3439
constructor(
3540
private readonly blockingActionService: BlockingActionService,
3641
private readonly diaBackendAuthService: DiaBackendAuthService,
3742
private readonly errorService: ErrorService,
3843
private readonly translocoService: TranslocoService,
39-
private readonly router: Router
44+
private readonly router: Router,
45+
private readonly platform: Platform
4046
) {
4147
combineLatest([
4248
this.translocoService.selectTranslate('email'),

0 commit comments

Comments
 (0)