0

流程: 成功登录后,我收到来自第 3 方渐进式 Web 应用程序的回调,其中包含用户的令牌。

问题 我无法捕捉到回调。使用 flutter_inappwebview 包。

代码片段:

InAppWebView(
                    key: webViewKey,
                    initialUrlRequest: URLRequest(
                      url: Uri.parse("Some URL"),
                      method: 'POST',
                      body: "Json data",
                    ),
                    initialOptions: options,
                    pullToRefreshController: pullToRefreshController,
                    onWebViewCreated: (controller) {
                      webViewController = controller
                        ..addJavaScriptHandler(
                            handlerName: "invokeAppCallBack",
                            callback: (args) => {
                                  print("Callback"),
                                  print("Callback invoked $args"),
                                });
                    },
}

错误: I/flutter (17289): {message: ReferenceError: Android is not defined, messageLevel: 1}

相关问题链接: https ://github.com/pichillilorenzo/flutter_inappwebview/issues/659

这是我第一次发布问题,所以我可能错过了一些需要在问题中提出的相关内容。

4

0 回答 0