Angular 网页不可用-位于com.googlecontent.apps的网页。。。无法加载,因为错误\u未知\u URL\u方案

Angular 网页不可用-位于com.googlecontent.apps的网页。。。无法加载,因为错误\u未知\u URL\u方案,angular,nativescript,google-oauth,Angular,Nativescript,Google Oauth,我在使用谷歌的oauth-2和nativescript时遇到了一些问题。在开始时,代码是 public onTapLogin() { console.log("I'm in onTapLogin"); this.authService .tnsOauthLogin("google") .then((result: ITnsOAuthTokenResult) => { console.log("back to login c

我在使用谷歌的oauth-2和nativescript时遇到了一些问题。在开始时,代码是

public onTapLogin() {
    console.log("I'm in onTapLogin");
    this.authService
        .tnsOauthLogin("google")
        .then((result: ITnsOAuthTokenResult) => {
          console.log("back to login component with token " + result.accessToken);
          this.routerExtensions
              .navigate(["../register"])
              .then(() => console.log("navigated to /authenticated"))
              .catch(err => console.log("error navigating to /authenticated: " + err));
        })
        .catch(e => console.log("Error: " + e));
    this.authService.tnsRefreshOAuthAccessToken()
  }

}
调用onTapLogin,然后调用tnsOAuthLogin

  public tnsOauthLogin(providerType): Promise<ITnsOAuthTokenResult> {
    this.client = new TnsOAuthClient(providerType);
    console.log('im in authservice.tnsoauthlogin ')
    return new Promise<ITnsOAuthTokenResult>((resolve, reject) => {
      console.log('im just calling loginWithCompletion')
      this.client.loginWithCompletion(
        (tokenResult: ITnsOAuthTokenResult, error) => {
          if (error) {
            console.error("back to main page with error: ");
            console.error(error);
            reject(error);
          } else {
            console.log("back to main page with access token: ");
            console.log(tokenResult);
            resolve(tokenResult);
          }
        }
      );
    });
  }
最后是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="__PACKAGE__"
    android:versionCode="1"
    android:versionName="1.0">

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"/>

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="__APILEVEL__"/>

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <activity
            android:name="com.tns.NativeScriptActivity"
            android:label="@string/title_activity_kimera"
            android:launchMode="singleTask"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
            android:theme="@style/LaunchScreenTheme">

            <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

            <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="***********"/>
            </intent-filter>
        </activity>
        <activity android:name="com.tns.ErrorReportActivity"/>
    </application>
</manifest>

其中android:scheme具有与urlscheme设置相同的url

有人知道这个问题的线索吗?如有任何建议,将不胜感激


我试着将我的Oauth google设置放在alex ziskind提供给我们的nativescript示例中,它似乎工作正常

您是否在Android上使用
Chrome
进行身份验证?你的Android版本是什么?我使用三星galaxy s6 5.1-API22模拟器的genymotion。此外,我还使用安装的默认浏览器,该浏览器使用从nativescript.docs下载的demo angular project。最后,我尝试了使用Facebook的oAuth,它可以正常工作。因此,我认为问题可能是重定向URI或其他设置错误(尽管我从google oAuthId安装程序收到了这些设置),如果你只是将URL放在锚定标记中并单击它,它会打开你的应用程序吗?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="__PACKAGE__"
    android:versionCode="1"
    android:versionName="1.0">

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"/>

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="__APILEVEL__"/>

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme">

        <activity
            android:name="com.tns.NativeScriptActivity"
            android:label="@string/title_activity_kimera"
            android:launchMode="singleTask"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode"
            android:theme="@style/LaunchScreenTheme">

            <meta-data android:name="SET_THEME_ON_LAUNCH" android:resource="@style/AppTheme" />

            <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="***********"/>
            </intent-filter>
        </activity>
        <activity android:name="com.tns.ErrorReportActivity"/>
    </application>
</manifest>