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

Android Google success shows 2 duplicate apps to return to on success #15

Closed
jbrown0824 opened this issue Dec 20, 2018 · 16 comments
Closed
Labels
android bug Something isn't working

Comments

@jbrown0824
Copy link

I set up Facebook and Google for Android. Facebook works as expected. However, with Google, after I've selected which account to connect, it then asks me to choose which app to go back to. It lists the correct app, but it lists it twice for some reason. Selecting one completely reopens the app, and so the connection doesn't work. Selecting the other takes you back to the open app and it DOES work.

The screenshot shows it split based on which I had previously selected but the first time it asked me it showed both in a list, both with app.temployee.app as the package name

Do you have any idea what I could be doing wrong?

screen shot 2018-12-20 at 12 47 10 pm

@moberwasserlechner
Copy link
Collaborator

moberwasserlechner commented Dec 21, 2018

Hi,

I experience the same behavior but only on simulator and while debugging on a device. In a production build the dialog is not displayed but users reported some weird problems.

Unfortunately I have no idea where this comes from. So if you have any logs or find anything please let me know so I can tackle the problem.

BR, Michael

@moberwasserlechner moberwasserlechner added bug Something isn't working android labels Dec 21, 2018
@moberwasserlechner moberwasserlechner added this to the beta1 milestone Dec 21, 2018
@jbrown0824
Copy link
Author

@moberwasserlechner I just tried installing it on a real device and am experiencing the same issue. I'm not very experienced with native android development (yet). Could you point me in a direction to find some logs that we can look through to try and diagnose the issue?

@moberwasserlechner
Copy link
Collaborator

Only if you release it in the Playstore the issue should be gone.

If you don't have any logs it's ok. I will try to find the bug myself but after the holidays ;)

@moberwasserlechner
Copy link
Collaborator

moberwasserlechner commented Feb 8, 2019

I think the schemes in the gradle file and the a scheme in a intent filter in the androidManifest.xml

build.gradle

android.defaultConfig.manifestPlaceholders = [
  'appAuthRedirectScheme': 'com.company.product'
]

are conflicting each other.

AndroidManifest.xml ... @string/custom_url_scheme

<activity
      android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
      android:name="com.byteowls.teamconductor.MainActivity"
      android:label="@string/title_activity_main"
      android:theme="@style/AppTheme.NoActionBarLaunch">

      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>

      <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="@string/custom_url_scheme" />
      </intent-filter>

    </activity>

I have no solution yet but you might try to change on or the other.

@michaeltintiuc
Copy link

I have stumbled upon the same issue, will see if doing above will solve anything

@mraible
Copy link

mraible commented Feb 22, 2019 via email

@michaeltintiuc
Copy link

I was able to fix this by adding android:host here:

            <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="@string/custom_url_scheme" android:host="@string/custom_host" />
            </intent-filter>

@moberwasserlechner
Copy link
Collaborator

moberwasserlechner commented Feb 25, 2019

@michaeltintiuc cool. What value has @string/custom_host? Is it the same as @string/custom_url_scheme?
thx

@michaeltintiuc
Copy link

Looks like it could be anything, I had it set to foo and oauth no difference whatsoever

@moberwasserlechner
Copy link
Collaborator

I just tried it (foo ;)) and it works. Will add this to the docs. Great find.

@moberwasserlechner
Copy link
Collaborator

Added a section formulated by @rgolea

@loonix
Copy link

loonix commented Jul 15, 2020

Hi Guys, I keep getting this on debug and release versions, does any of you know what can be done to fix this? I have followed the steps that were added to the documentation.

@mdenieffe
Copy link

mdenieffe commented Sep 20, 2020

@loonix I'm having the same issue on the emulator where it's displaying a duplicate app to return control to, (I haven't tested the release version) but I seemed to have gotten around it with the following configuration

build.gradle

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    defaultConfig {
        applicationId "your-app"
       ...
        manifestPlaceholders = ['appAuthRedirectScheme': 'your-scheme']
    }
    ...
}

strings.xml

<?xml version='1.0' encoding='utf-8'?>
<resources>
    ...
    <string name="custom_url_scheme">your-scheme</string>
</resources>

AndroidManifest.xml

    <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="none" />  <!-- might not be needed?? -->
    </intent-filter>

I'm not an Android developer so I can't explain why this configuration is working for me, but it might be of help.

Thanks.

@loonix
Copy link

loonix commented Sep 20, 2020

Thanks bro, will give it a shot

@marianapatcosta
Copy link

marianapatcosta commented Aug 18, 2021

Hi. I'm using this plugin in my ionic/capacitor project and follow the setup described for Android. Everything was working great using the emulator but when I installed the .apk in my android device, the app launch icon was not on the screen, though the installation was successful and the app was listed in installed apps. After some try/error attemptives, I figured out that if I removed the fix for this issue ( <data android:scheme="@string/custom_url_scheme" android:host="oauth" /> in AndroidManifest.xml), I was able to run the app in the device, as expected. Do you know why is this happening? Also, with or without the fix, I did not experience the bug reported in this issue.
Thanks.

@moberwasserlechner
Copy link
Collaborator

Hi @marianapatcosta,

you wrote:

Also, with or without the fix, I did not experience the bug reported in this issue.

You did not experience this issue. Could you please create a new issue, describing your problem and giving the information asked by the issue template.

Thx & BR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants