Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Sign In not working on iOS devices #5523

Closed
2 of 14 tasks
kavienanj opened this issue Oct 3, 2024 · 4 comments
Closed
2 of 14 tasks

Social Sign In not working on iOS devices #5523

kavienanj opened this issue Oct 3, 2024 · 4 comments
Labels
Authenticator Issues related to the Authenticator UI Component

Comments

@kavienanj
Copy link

kavienanj commented Oct 3, 2024

Description

The SSO authentication is working perfectly on Android Devices and even iOS Simulator. But not in physical iOS devices. We couldn't find what could be the issue. We used Firebase and Onesignal services too. But even after stripping out the dependencies and making the app this simple the issue still persists.

When the sso button is clicked the prompt appears, but before we press continue its is getting dismissed immediately. After the first time repeated presses doesn't trigger anything.

The code is very simple,

import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_authenticator/amplify_authenticator.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:flutter/material.dart';

import 'amplifyconfiguration.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    _configureAmplify();
  }

  void _configureAmplify() async {
    try {
      await Amplify.addPlugin(AmplifyAuthCognito());
      await Amplify.configure(amplifyconfig);
      safePrint('Successfully configured');
    } on Exception catch (e) {
      safePrint('Error configuring Amplify: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    return Authenticator(
      child: MaterialApp(
        builder: Authenticator.builder(),
        home: const Scaffold(
          body: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('You are logged in!'),
              SizedBox(height: 20),
              Center(child: SignOutButton()),
            ],
          ),
        ),
      ),
    );
  }
}

The pubspec.yaml

environment:
  sdk: '>=3.4.1 <4.0.0'
dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.6
  amplify_flutter: ^2.4.1
  amplify_auth_cognito: ^2.4.1
  amplify_authenticator: ^2.1.3

Behavior on a Physical iOS 18 iPhone,

WhatsApp.Video.2024-10-03.at.17.53.26.mp4

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

Run the above code

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.24.0

Amplify Flutter Version

2.4.1

Deployment Method

Amplify Gen 2

Schema

No response

@github-actions github-actions bot added pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Oct 3, 2024
@kavienanj kavienanj changed the title Social Sign In not working on latest iOS devices! Social Sign In not working on iOS devices! Oct 3, 2024
@kavienanj kavienanj changed the title Social Sign In not working on iOS devices! Social Sign In not working on iOS devices Oct 3, 2024
@kavienanj
Copy link
Author

We finally found what the issue. We completely got rid of Onesignal and Firebase integration from the project. I would like to know why amplify and firebase/onesignal can't coexist in a single project?

@Equartey Equartey added the Authenticator Issues related to the Authenticator UI Component label Oct 3, 2024
@Equartey
Copy link
Contributor

Equartey commented Oct 3, 2024

Hi @kavienanj, I'm unsure what the collision was between the packages, but one cause of the obersved behavior is from not setting the iOS minimum deployment target. We have this process outlined in our docs here: https://docs.amplify.aws/gen1/flutter/start/project-setup/platform-setup. Can you confirm these properties were set when you saw the issue?

@github-actions github-actions bot removed the pending-maintainer-response Pending response from a maintainer of this repository label Oct 3, 2024
@kavienanj
Copy link
Author

@Equartey YESS, You are right. We tried that and it worked. Since we referred to this docs page we have missed that setup https://docs.amplify.aws/flutter/build-a-backend/auth/sign-in-with-web-ui/. In this page, it doesn't mention any platform setup for iOS. Now our app is working as expected. Thank you for your support. I am closing the issue.

@github-actions github-actions bot added the pending-maintainer-response Pending response from a maintainer of this repository label Oct 4, 2024
@github-actions github-actions bot removed pending-triage This issue is in the backlog of issues to triage pending-maintainer-response Pending response from a maintainer of this repository labels Oct 4, 2024
Copy link

github-actions bot commented Oct 4, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authenticator Issues related to the Authenticator UI Component
Projects
None yet
Development

No branches or pull requests

2 participants