在另一个活动中未从RedirectUriReceiverActivity收到意图

我陷入一个非常简单的问题,无法获得线索,因此需要您的建议。因此,我尝试对使用net.openid.appauth.AuthorizationRequest的GoogleDrive API进行身份验证,我创建了一个Pending意向并将其传递给授权服务进行performAuthorizationRequest。以下是该示例代码:

AuthorizationServiceConfiguration serviceConfiguration = new AuthorizationServiceConfiguration(
        Uri.parse(AUTH_ENDPOINT_URL),Uri.parse(TOKEN_ENDPOINT_URL)
);
Uri redirecturi = Uri.parse(getRedirecturi());
AuthorizationRequest.Builder builder = new AuthorizationRequest.Builder(
        serviceConfiguration,“Xyzzy….”,AuthorizationRequest.RESPONSE_TYPE_CODE,redirecturi
);

    builder.setScopes("https://www.googleapis.com/auth/drive","https://www.googleapis.com/auth/drive.readonly");

AuthorizationRequest request = builder.build();
if (authorizationService != null) {
    authorizationService.dispose();
}
authorizationService = new AuthorizationService(activity);

Intent postAuthorizationIntent = new Intent(“HANDLE_YOUTUBE_AUTHORIZATION_RESPONSE_actION”);
postAuthorizationIntent.setflags(Intent.flaG_actIVITY_SINGLE_TOP | Intent.flaG_actIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getactivity(context,request.hashCode(),postAuthorizationIntent,0);
authorizationService.performAuthorizationRequest(request,pendingIntent);

现在,这将重定向到google驱动器的“权限”页面,当我单击“允许(权限)”时,我将收到一个返回到“活动”的意图,该意图被添加到“ pendingIntent”中。我可以看到RedirecturiReceiveractivity活动的onCreate被调用并将其意图发送到目标

try {
    target.send(this,responseData);
} catch (CanceledException var10) {
    Logger.errorWithStack(var10,"Unable to send pending intent",new Object[0]);
} 

尝试从RedirecturiReceiveractivity onCreate()函数捕获代码

清单文件中的代码: RedirecturiReceiveractivity已添加到清单文件中:

<activity android:name="net.openid.appauth.RedirecturiReceiveractivity">

,并且还添加了视图浏览权限。

我面临的问题是我无法收到此意图。我在我的活动中覆盖了onNewIntent(),我希望此未完成的意图能够返回。但是没有帮助。我是否需要重写其他任何功能,还是缺少某些功能?

从活动中创建的Fragment中调用AuthorizationService API。

任何人都可以建议为什么未在活动中收到意图的原因。任何帮助/指导都将受到高度赞赏。

liu1809 回答:在另一个活动中未从RedirectUriReceiverActivity收到意图

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2731582.html

大家都在问