android - Firefox 或互联网浏览器的 FitBit oAuth 问题

标签 android authentication browser oauth fitbit

我已将 Fitbit 与我的 Android 应用程序集成。我在使用 Chrome 浏览器连接到 Fitbit 时没有遇到任何挑战,但是当我尝试将它连接到 Firefox 或默认互联网浏览器时,它无法正常工作。

下面是我正在使用的 Intent 过滤器:

<activity
            android:name=".MyActivity"
            android:launchMode="singleTop"
            android:resizeableActivity="false"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">

            <!-- FitBit intent filter to get call back data for Authentication API -->
            <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="myfitbit"/>
            </intent-filter>
        </activity>

请提出建议。

最佳答案

我想通了这个问题。

我使用了 android:launchMode="singleTop",这阻止了我的应用程序在接收者 Activity 的 onNewIntent() 上接收 oAuth token 。但这种情况只有在我尝试使用 Chrome 以外的任何浏览器连接到 Fitbit 时才会发生。最后,我将启动模式更改为 android:launchMode="singleTask"

更多详情,请访问https://stackoverflow.com/a/36942185/3627429回答。

关于android - Firefox 或互联网浏览器的 FitBit oAuth 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45642820/

相关文章:

php - Laravel 5.4 多重身份验证 - Auth::guard()->user() 空

php - 通过 Web API 将 YouTube 视频上传到单个 channel

html - 为什么要使用数据 URI 方案?

android - 当编辑文本获得焦点时滚动页面

android - Android 上的 Google Analytics 给出平均网站持续时间 : 00:00:00

java - Spring Boot安全请求方法 'POST'不支持

jQuery 代码在 Chrome 和 IE 中无法正常工作

google-chrome - 为什么 Chrome 版本 29 如此受欢迎?

java - 如何让 Apache Commons Net 在 Android 中工作? - java.lang.NullPointerException 错误

android - 选择 Android Webview 中使用的动画以获得高性能