Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase dynamic link not open in development app while app is not in appstore

My concern is as i have not upload on app store but when i click on deeplink url debug mode application is not open its redirect on Appstore

I AM ABLR to redirect on my debug application.

I am working on dynamic link objective c

as i have tested my app is configure fine in firebase

but when I am share my product with other user they tap on url its redirect on safari and link is not working

every time i have to copy the link and past into chrome and also here poup u comes like your app is open another application then redirect to app ...

I WANT THAT WHEN I CLICK ON LINK IT REDIRECT DIRECT ON APPLICATION RATHER THEN SAFARI OR MANUALLY COPY THAT LINK AND THEN OPENAPP

Note: application is not live i want to open url my debug application.

I have configure the application for getting appstoreid and teamid

-(BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:

My link not working in safari but its working on chrome how to manage to work on safari as well...

Thanks in advance.

like image 732
Akash Raghani Avatar asked Oct 17 '19 14:10

Akash Raghani


2 Answers

The options below are assumed that you created a Firebase project in any plan. If you don't have, check the docs

Option 1: Open in browser to a website (see source guide)

If you are using Cloudflare for DNS records management, please DO NOT proxy the origin IP addresses to the domain (or the subdomain) you wish to use Dynamic Links for your domain, as Google might not verify your domain because they don't use TXT verification as GitLab Pages does.

  1. Set up Firebase Hosting if you haven't done this after project creation.
  2. After setting up, open Dynamic Links.
    • New to Dynamic Links? Click Get started. Otherwise, click Add URL prefix. You can only add up to 5 URL prefixes per project.

      If you use a domain/subdomain for Hosting or Dynamic Links, you can't use it again for Dynamic Links and vice versa. Try link prefixes (for example, demofirebaseproject.devhubcentral.ml/launchapp/insert-link-suffix-here) or an special subdomain (for example, demofirebaseproject.devhubcentral.ml/insert-link-suffix-here) instead.

    • A setup wizard pops out. Type the domain you want to use and Google will show suggestions for you based on what you type. Choose wisely, then click Next. In our example project ID nomadic-bedrock-257008, I use demofirebaseproject.devhubcentral.ml for this tutorial
    • Now, configure your options for the domain you want to use. The path prefix I use for the demo project is /launchapp because the devs at the Pins team want to use demofirebaseporject.devhubcentral.ml/launchapp to launch in the Pins' official app, but surely, this app will be available in App Store soon. For now, we redirect users to contributors-program.recaptime.tk. When ready, click Next.
    • Then, fire up your DNS provider and add 151.101.1.195 and 151.101.65.195 as A records for the domain/subdomain you use. In our demo project, I am using Cloudflare to manage DNS records for devhubcentral.ml, so I need to change Proxy Status to DNS Only for ownership checks. See the screenshot to see how I configured it. When done, click Finish and create your first Dynamic Link.

      DNS propagation usually takes 24 hours or longer, but some DNS provider/domain registrars propagate DNS records sooner.

  3. For iOS only: Open Info.plist file in your Xcode project and add the following code below. Replace sample strings into the ones for your project and add more strings as needed.
<key>FirebaseDynamicLinksCustomDomains</key>
<array>
  <string>demofirebaseproject.devhubcentral.ml/launchapp</string>
</array>

You add up to 10 prefixes per Firebase project. If you need more, remove prefixes that you don't use.

Option 2: Try in your debug app (and share to your other devs for testing)

  1. Open your Firebase project overview and Xcode project.
  2. Click the plus icon then select an iOS icon.
  3. Register your app's basic info.
  4. Download the GoogleService-Info.plist file into your Xcode project root folder.
  5. Open a terminal, use pod init if you don't have a Podfile. Edit it to add the below. Save it and then run pod install to generate a .xcworkspace for your project. Use this file for all future development on your application.
# add the Firebase pod for Google Analytics
pod 'Firebase/Analytics'
# add pods for any other desired Firebase products
# https://firebase.google.com/docs/ios/setup#available-pods
  1. Add the init code to your app codebase using this below for Swift.
import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  var window: UIWindow?

  func application(_ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions:
      [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    FirebaseApp.configure()
    return true
  }
}

Have Objective-C project instead? Maybe use this code instead

@import UIKit;
@import Firebase;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 [FIRApp configure];
 return YES;
}
  1. Run your app to verify the installation. If you don't have a project yet, skip this step and try again later.
  2. Try option 1 above, but this time, we're using your iOS app for this one.

Option 3: Publish your production-ready app to App Store

Do not proceed if you won't comply with the license agreement or you can't pay the yearly membership fee

WARNING: Only publish your app to App Store when production-ready. If not yet, try deploying to TestFlight first.

This option is recommended, but you need to have an Apple ID protected by 2-factor authentication and:

  • provide basic personal information about yourself if enrolling as an individual
  • if enrolling as an organization, requires:
    • your org's D-U-N-S number (New to D-U-N-S numbers? See this help center article to get started)
    • has a legal entity status (not for DBAs, fictitious businesses, trade names, or branches)
    • the person who enrolling your org must have the legal authority to fill and sign agreements with Apple and other companies.
    • a public viewable website associated with your org
  • prepare 99 USD (or local equivalent in your country after conversion) for the yearly membership fee.

For FAQs about enrolling in Apple Developer Program, see https://developer.apple.com/support/enrollment. To get started, visit enrollment page, click Start Your Enrollment when compliance checks are done (I mean when you met the requirements above), sign in your Apple ID and start filling up paperwork.

IMPORTANT: Read the license agreement first with your org's legal department or your attorney if enrolling as an individual. You must not only read it but also understand it.

When your app is published, then add your app and configure it as usual.

Troubleshooting Link doesn't work in Safari

QUICK NOTE: Like in this answer, you need to add this code to your the configuration file, like this:

{"applinks": {
  "apps":[],
  "details":[{
      "appID":"495878282985.madebythepinsteam.publicofficialapp", // Change it with your Apple Store ID.
      "paths":["NOT /_/*","/*"]}
  ]}
}

If the code above is wrong, feel free to test and edit.

  • Check whether you follow the instructions set herein.
  • If the instructions I gave are not enough, then look around the internet for troubleshooting. Maybe you read some docs as a refresher. The documentation is the first place to look around for answers.
  • Check whether your iOS device is up-to-date. If the issue was the OS itself, check the app code and debug.
  • Test the app again. If not works, repeat the steps above until the problem solved.
like image 115
Andrei Jiroh Eugenio Halili Avatar answered Nov 02 '22 08:11

Andrei Jiroh Eugenio Halili


I assume you forgotten to do some configuration in Firebase. In my case during development, I just put a placeholder AppStore ID in my Firebase project. E.g. 1234567890 and my Team ID, which makes dynamic links in debug builds possible.

I can't find the original text, but I remember that Firebase tells you that you need to insert a Team ID and AppStore ID to make dynamic links to work.

Once you created the dynamic link, you need to check the apple-app-site-association endpoint of your dynamic link. E.g.

https://yourveryown.page.link/apple-app-site-association

The result must be something like this (it might take some time to refresh):

{"applinks":{"apps":[],"details":[{"appID":"YOURTEAMID.com.yourcompany.app","paths":["NOT /_/*","/*"]}]}}

So to summarize:

  • Make sure that you have insert some Appstore ID;
  • Make sure the Team ID is properly set and the same ID is being used during compilation of your app;

enter image description here

like image 25
gi097 Avatar answered Nov 02 '22 08:11

gi097