aboutyou/dart_packages

Redirects to google play store

Closed this issue · 9 comments

Hello, as the title suggests, when I implement all of this, it redirects me to the Google Play store. The google play store just says "something went wrong, try again".

This is happening on my Samsung Galaxy (with chrome/firefox installed) and also on my Pixel 4 emulator (has firefox installed).
The sign in is a success. And if I open back the customtab, I can see the redirection parameters and everything so that seems fine. But for some reason it keeps on redirecting to the google play store and saying "something went wrong".

I've setup a glitch remix and inputted all my variables. Did the same with the apple configuration stuff as well.

Is there a way I can find out more about what to do?

More details: I'm using the gltich server example. In my flutter app, I have the redirect_uri set to the /callbacks/sign_in_with_apple.

@Kennnv could you please share your AndroidManifest and the URL that the glitch server generates (with the private parts stripped out)?

Certainly:
My manifest:

<application
        android:label="appname"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>

        </activity>
        <!-- Set up the Sign in with Apple activity, such that it's callable from the browser-redirect -->
        <activity
            android:name="com.aboutyou.dart_packages.sign_in_with_apple.SignInWithAppleCallback"
            android:exported="true"
            >
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data android:scheme="signinwithapple" />
                <data android:path="callback" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>

Callback url

intent://callback?code=<code>&id_token=<jwttoken>#Intent;package=androidappid;scheme=signinwithapple;end

And you package name in the URL also aligns with the one in your manifest?

The Google Play redirect happens when Android can't find a matching package or activity that can handle the link

yes that's correct. When I replaced it for the comment I didn't keep it consistent. But that did get me thinking, if I'm debugging the app, would my package name be slgihtly different? e.g. if I'm running flutter run --debug

Also, does it matter if the ios bundleID is moderately different to my android package id?

Nevermind. You were right on the package name. I had to install a package name viewer on my emulator to find out the actual package name. It'll probably work now. Thank you for your help

@Kennnv your package name should also be defined in your AndroidManifest actually as the package property of the manifest element

But nice to get this solved then

Yeah the package property shows the com.example.appname. But with the package identifier app it shows it's com.companyname.appname instead. That was 4 hours debugging down the drain haha