首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么Deep Link Web URL查询为空

为什么Deep Link Web URL查询为空
EN

Stack Overflow用户
提问于 2020-03-10 21:24:52
回答 1查看 3.2K关注 0票数 2

使用Flutter和Firebase动态链接,我可以创建一个链接。当它被点击时,它会打开应用程序,但没有链接数据,也不会触发任何链接被点击的回调。相反,在Xcode日志中,我得到Notes是从应用程序复制到Deep Link Web URL query is empty中,然后单击。我是否遗漏了什么,或者我还可以检查什么来使其正常工作?

Firebase Deep Link Web URL query is empty - iOS查看了这篇相关文章,但安装所需的pod依赖项不是解决方案,正如您可以在下面的pod安装日志中看到的那样。

颤动医生

代码语言:javascript
复制
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15 19A582a, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.1.4)
[!] IntelliJ IDEA Community Edition (version 2019.1.3)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.43.0)
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.

Xcode日志

代码语言:javascript
复制
---- Firebase Dynamic Links diagnostic output start ----
Firebase Dynamic Links framework version 4.0.7
System information: OS iOS, OS version 13.3.1, model iPhone
Current date 2020-03-10 12:46:34 +0000
Device locale en-US (raw en_US), timezone America/Boise
    Specified custom URL scheme is com.pitch.links and Info.plist contains such scheme in CFBundleURLTypes key.
    AppID Prefix: XXXXXXXXXX, Team ID: XXXXXXXXXX, AppId Prefix equal to Team ID: YES
performDiagnostic completed successfully! No errors found.
---- Firebase Dynamic Links diagnostic output end ----
Runner[366:14705] 6.18.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
Runner[366:14754] 6.18.0 - [Firebase/Analytics][I-ACS800003] Registered an SDK that has already registered. Default flags will be overwritten. SDK name: app_measurement
Runner[366:14754] 6.18.0 - [Firebase/Analytics][I-ACS800023] No pending snapshot to activate. SDK name: app_measurement
Runner[366:14712] Connection 3: received failure notification
Runner[366:14712] Connection 3: failed to connect 12:8, reason -1
Runner[366:14712] Connection 3: encountered error(12:8)
Runner[366:14712] Task <03A1535D-FD13-4872-B14B-6673E202F028>.<2> HTTP load failed, 0/0 bytes (error code: -1003 [12:8])
Runner[366:14712] Task <03A1535D-FD13-4872-B14B-6673E202F028>.<2> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x282e21b30 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=https://firebasedynamiclinks-ipv6.googleapis.com/v1/installAttribution?key= AIzaxxxxxxx_xxxxxxxxxx_xxxxxxxxxxxxxxxx, NSErrorFailingURLKey=https://firebasedynamiclinks-ipv6.googleapis.com/v1/installAttribution?key= AIzaxxxxxxx_xxxxxxxxxx_xxxxxxxxxxxxxxxx, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=A server with the specified hostname could not be found.}
Runner[366:14505] [ProcessSuspension] 0x10e4e13b0 - ProcessAssertion::processAssertionWasInvalidated()
Runner[366:14505] [ProcessSuspension] 0x10e4e1410 - ProcessAssertion::processAssertionWasInvalidated()
Runner[366:14707] 6.18.0 - [Firebase/Analytics][I-ACS023012] Analytics collection enabled
Runner[366:14707] 6.18.0 - [Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
    dismiss = 1;
    "is_weak_match" = 1;
}
Runner[366:14505] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
Runner[366:14505] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
Runner[366:14505] Returning local object of class NSString
Runner[366:14505] Can't end BackgroundTask: no background task exists with identifier 14 (0xe), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.
Runner[366:15138] 6.18.0 - [Firebase/Analytics][I-ACS023000] Deep Link Web URL query is empty

apple-应用-站点-关联

代码语言:javascript
复制
{"applinks":{"apps":[],"details":[{"appID":"XXXXXXXXXX.com.pitch.links","paths":["NOT /_/*","/*"]}]}}

已将applinks:pitchlink.page.link列为关联的域名和URL类型,其标识符为捆绑ID和URL方案com.pitch.links已添加到Info.plist

颤动main.dart

代码语言:javascript
复制
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Dynamic Links',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Dynamic Links'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Uri dynamicUrl;

  @override
  void initState() {
    super.initState();
    this.initDynamicLinks();
  }

  void initDynamicLinks() async {
    final DynamicLinkParameters parameters = DynamicLinkParameters(
      uriPrefix: 'https://pitchlink.page.link',
      link: Uri.parse('https://example.com/suffix?d=1'),
      iosParameters: IosParameters(
        bundleId: 'com.pitch.links',
        minimumVersion: '0.0.1',
      ),
    );
    FirebaseDynamicLinks.instance.onLink(
        onSuccess: (PendingDynamicLinkData dynamicLink) async {
      final Uri deepLink = dynamicLink?.link;
      print(deepLink.toString());
    }, onError: (OnLinkErrorException e) async {
      print('onLinkError');
      print(e.message);
    });
    ShortDynamicLink link = await parameters.buildShortLink();
    setState(() {
      dynamicUrl = link.shortUrl;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Dynamic Link:',
            ),
            dynamicUrl != null
                ? SelectableText(
                    dynamicUrl.toString(),
                  )
                : Container(),
          ],
        ),
      ),
    );
  }
}

pubspec.yaml

代码语言:javascript
复制
name: pitch_links
description: A new Flutter project.
version: 0.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  firebase_dynamic_links: ^0.5.0+11
  firebase_analytics: ^5.0.11
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

pod安装--清理-安装--详细

代码语言:javascript
复制
-> Using Firebase (6.18.0)
-> Using FirebaseAnalytics (6.3.0)
-> Using FirebaseAnalyticsInterop (1.5.0)
-> Using FirebaseCore (6.6.3)
-> Using FirebaseCoreDiagnostics (1.2.1)
-> Using FirebaseCoreDiagnosticsInterop (1.2.0)
-> Using FirebaseDynamicLinks (4.0.7)
-> Using FirebaseInstallations (1.1.0)
-> Using Flutter (1.0.0)
-> Using GoogleAppMeasurement (6.3.0)
-> Using GoogleDataTransport (4.0.1)
-> Using GoogleDataTransportCCTSupport (1.4.1)
-> Using GoogleUtilities (6.5.1)
-> Using PromisesObjC (1.2.8)
-> Using firebase_analytics (0.0.1)
-> Using firebase_dynamic_links (0.1.0)
-> Using nanopb (0.3.9011)
EN

回答 1

Stack Overflow用户

发布于 2020-03-10 23:53:25

解决我的问题的解决方案是在initDynamicLinks()中调用await FirebaseDynamicLinks.instance.getInitialLink();,同样的错误仍然出现在Xcode日志中,但我能够解析出链接数据。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60618585

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档