koji-1009 / flutter_auth_ui

A Flutter plugin for using the Firebase Auth UI with Dart in Flutter apps. (not official plugin.)
https://pub.dev/packages/flutter_auth_ui
36 stars 10 forks source link

Email Link is not working? #66

Closed EskAere closed 3 years ago

EskAere commented 3 years ago

I've setup Email Link in the past with Firebase Auth, and it was working fine.

I've discovered this plugin (thank you for that) and want to try it out! Google and Facebook work fine. However, I can't make the email link work properly.

I receive the email, but once I click on the email link and get back to the app, nothing happens!

Here is my code : emailAuthOption: EmailAuthOption( enableMailLink: true, handleURL: 'https://myapp.page.link', androidPackageName: 'com.mycompany.myapp', androidMinimumVersion: '1', ),

That's the only error I have : I/flutter ( 6089): flutter_auth_ui: error => PlatformException(0, error result, null, null)

Let me know if it's a known issue or if I'm missing something

koji-1009 commented 3 years ago

@EskAere I'm sorry, there seems to be a problem. Does it work with 2.2.0?

koji-1009 commented 3 years ago

Would you tell us about the following questions?

EskAere commented 3 years ago

@koji-1009

Does it work with 2.2.0?

If I haven't made a silly mistake, no

Is this issue happening on iOS?

I don't have an iOS env.

Do options such as "https://myapp.page.link" contain the values ​​set on the firebase console?

Yes everything is setup properly. I've manually implemented dynamic links and it is working. But ideally I'd like to avoid doing the custom auth ui

koji-1009 commented 3 years ago

Oops, the log format is certainly Android logcat.

koji-1009 commented 3 years ago

I figured out the problem. It seems that there is not enough implementation to receive deep link on Android, so I will support it.

koji-1009 commented 3 years ago

@EskAere

Problem solved! It needs some more time before it is released, as it needs to be reviewed and the README updated.

If you want to check it at hand, please try the following changes.

pubspec.yaml

  flutter_auth_ui:
    git:
      url: https://github.com/koji-1009/flutter_auth_ui
      path: flutter_auth_ui
      ref: android_emaillink

MainActivity.java

import android.content.Intent;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.dr1009.app.flutter_auth_ui.FlutterAuthUiPlugin;

import io.flutter.embedding.android.FlutterActivity;

public class MainActivity extends FlutterActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // check intent
        FlutterAuthUiPlugin.catchEmailLink(this, getIntent());
    }

    @Override
    protected void onNewIntent(@NonNull Intent intent) {
        super.onNewIntent(intent);

        // check intent
        FlutterAuthUiPlugin.catchEmailLink(this, intent);
    }
}
koji-1009 commented 3 years ago

I released 2.3.1!

EskAere commented 3 years ago

@koji-1009 Thank you! I'll try this tomorrow ♥