我在使用AppAuth处理从webview返回到应用程序的重定向时遇到问题。我一直在找net::ERR_UNKNOWN_URL_SCHEME。在我的build.gradle中,我在defaultConfig中声明了清单占位符
manifestPlaceholders= [
'appAuthRedirectScheme': 'com.example.mc2017'
]在清单中我得到了RedirectUriReceiverActivity
<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
<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="com.example.mc2017"/>
</intent-filter>
</activity>其中com.example.mc2017应该是我正在监听的方案。有人能告诉我哪里出了错吗?
发布于 2017-11-30 18:04:40
1-你应该为placeHolders使用${...}模式,但无论如何你永远不会在你的清单中使用占位符。
2-您可以为您的url使用模式,例如myApp://com.example.mc2017,在本例中,您的声明如下所示:
<activity android:name="net.openid.appauth.RedirectUriReceiverActivity">
<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:host="com.example.mc2017"
android:scheme="myApp"/>
</intent-filter>
</activity>https://stackoverflow.com/questions/47570640
复制相似问题