ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Getting started with Dynamic Links on iOS - Pt.2 (Firecasts)

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • So now that you know how to create dynamic links, we're going to show you how to do receive and interpret this dynamic link in your iOS project.
    Receive Dynamic Links on iOS doc → bit.ly/2PqHJue
    Watch Pt.1 Getting started with Firebase Dynamic Links on iOS → bit.ly/2yyBwVN
    Firecasts Playlist → bit.ly/2LfjL2z
    Keep up with the latest from Firebase, subscribe! → bit.ly/2KUciWJ

ความคิดเห็น • 28

  • @lucye7320
    @lucye7320 4 ปีที่แล้ว +1

    Super kickstart video for Dynamic Links on iOS, thanks!

  • @RomanMedvid
    @RomanMedvid 5 ปีที่แล้ว +1

    Excellent. Thanks for the great video

  • @jeessonsooraj7006
    @jeessonsooraj7006 4 ปีที่แล้ว

    great video

  • @linkonsid8883
    @linkonsid8883 ปีที่แล้ว +2

    I'm trying to open the app from deeplink when the app is closed. It does open my app but open url methods are not called. What should I do here?

  • @srstudios6374
    @srstudios6374 5 ปีที่แล้ว +4

    any chance of the RecipeRally project making it to github?

  • @nigelpstreet
    @nigelpstreet 5 ปีที่แล้ว

    Hi, I'd like to use a DynamicLink with an Enterprise distribution app, so it doesn't (can't) have even a placeholder App Store entry, and therefore no Apple ID - can I use an alternative to the Apple ID, or perhaps one borrowed from another app, like you suggest?

  • @mohammedshraim6412
    @mohammedshraim6412 5 ปีที่แล้ว +2

    better than Apple documentation :)
    Thanks

  • @migurena
    @migurena 3 ปีที่แล้ว +1

    I OWE YOU MY LIFE

  • @user-pf6th7oo5m
    @user-pf6th7oo5m 4 ปีที่แล้ว +9

    It seems to have to write down the codes "continue activity" inside scene delegate, not app delegate if you use iOS above 13.

    • @artuhrtsau8301
      @artuhrtsau8301 3 ปีที่แล้ว +4

      I think it's func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { } on sceneDelegate, I hope this reply could help other people who met same issue as I did.

    • @H0neyHunter
      @H0neyHunter ปีที่แล้ว

      @@artuhrtsau8301 not working :(
      Fully AppDelegate Code
      func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
      if let incomingURL = userActivity.webpageURL {
      let linkHandled = DynamicLinks.dynamicLinks().handleUniversalLink(incomingURL) { DynamicLink, error in
      guard error == nil else {
      print(error?.localizedDescription ?? "")
      return
      }
      if let dynamicLink = DynamicLink {
      self.handleIncomingDynamicLink(dynamicLink)
      print("continue url app çalıştı \(dynamicLink)")
      }
      }
      if linkHandled {
      return true
      }else {
      return false
      }
      }
      return false
      }
      //Deep Link Uygulama Yüklü değilken çalıştı.
      //Deep Link
      func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
      print("open url app çalıştı \(url.absoluteString)")
      if let dynamiclinks = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
      self.handleIncomingDynamicLink(dynamiclinks)
      return true
      }else {
      return false
      }
      }
      //DEEP LİNK
      func handleIncomingDynamicLink(_ dynamicLink: DynamicLink){
      guard let url = dynamicLink.url else {
      print("That's weiird. My dynamic link object has no url return")
      return
      }
      //Doğru Yönetm Buu Bölüm
      /*
      guard let components = URLComponents(url: url, resolvingAgainstBaseURL: false), let queryItems = components.queryItems else {return}
      for i in queryItems {
      print("Değer: \(i.value ?? "Alamadı")")
      UserDefaults.standard.set(Int(i.value!), forKey: "ilanno")
      NotificationCenter.default.post(Notification(name: Notification.Name("didReceiveNotification")))
      break
      }
      */
      print("Your incoming link parameter is \(url.absoluteString)")
      let urls = url.absoluteString
      if let index = urls.range(of: "/data?=")?.upperBound {
      let dataSubstring = String(urls[index...])
      UserDefaults.standard.set(Int(dataSubstring), forKey: "ilanno")
      NotificationCenter.default.post(Notification(name: Notification.Name("didReceiveNotification")))
      }

      }

  • @umtlabs7433
    @umtlabs7433 4 ปีที่แล้ว +2

    Let's say your app is installed on your device already but it is not running in the background. If you now click the dynamic link, it will open your app, but application(_:continue userActivity:) does NOT get called. So how could you receive the dynamicLink URL in this scenario?

    • @saeedurrehman7563
      @saeedurrehman7563 3 ปีที่แล้ว

      @MB Falafel scene(_ scene: UIScene, continue userActivity: NSUserActivity) { }

  • @manuelcubillo55
    @manuelcubillo55 4 ปีที่แล้ว +3

    I tried this and it opens the app, but it never hits the application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) app delegate method. I'm not sure what I'm doing wrong. Has anyone else ran into this issue?

    • @manuelcubillo55
      @manuelcubillo55 4 ปีที่แล้ว +6

      I ended up finding out why it wasn't being called in my case. I created a brand new Xcode 11 project which is using scenedelegate as well as appdelegate. Universal links calls this method func scene(_ scene: UIScene, continue userActivity: NSUserActivity) in the scenedelegate instead of the appdelegate. Full explanation here github.com/firebase/firebase-ios-sdk/issues/3918

    • @tapashm42
      @tapashm42 4 ปีที่แล้ว

      @@manuelcubillo55 Can you please help me? I am facing one problem. It's working fine when the app is running and in the background. But when the app is installed but not launched at that time it's simply opening the app but not redirecting to the respective screen. Please help me to get out of this situation. Here is my code:
      func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
      return application(app, open: url,
      sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
      annotation: "")
      }
      func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
      if let dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromCustomSchemeURL: url) {
      if dynamicLink.matchType == .unique {
      handleDynamicLink(dynamicLink)
      }
      return true
      }
      return false
      }

  • @ritumathurwedig
    @ritumathurwedig ปีที่แล้ว

    It is not working when app preview page is disabled.

  • @vanessanajem6491
    @vanessanajem6491 3 ปีที่แล้ว +1

    Restorationhandler method not being called. Can't seem to find the issue

  • @SveeNe1000
    @SveeNe1000 5 ปีที่แล้ว +1

    Hello, have some questions. Here you "hardcoded" deep link parameters (hello=something, foo=something). But what if I need to send links to 100 people and I need these parameters to be unique for each person?

  • @hugovangalen
    @hugovangalen 3 ปีที่แล้ว +1

    So... these links are not really Dynamic Links. The name is very confusing and misleading :-)
    When setting them up in Firebase, they are basically "fixed" URLs. Any additional parameter=value in the URL is not passed-through to the app.
    So it's impossible to use a unique link, say, for each user of your app without constructing such a "fixed" link via Firebase. So you need to manage thousands if not tens-of-thousands such URLs, a problem that would neatly be solved if these would be truly dynamic.

    • @NesCroft
      @NesCroft 3 ปีที่แล้ว +1

      thats where i'm stuck too. i need to send an event id with the link. any solutions besides creating a ton of these "dynamic" links?

  • @soga_pg
    @soga_pg ปีที่แล้ว

    6:55

  • @Gojo___Gojo362
    @Gojo___Gojo362 ปีที่แล้ว

    Dynamic Links do not work from first start . рщц

  • @soga_pg
    @soga_pg ปีที่แล้ว

    3:20

  • @americaneagle404
    @americaneagle404 4 ปีที่แล้ว

    doesn't work