react-native-firebase icon indicating copy to clipboard operation
react-native-firebase copied to clipboard

🔥Invalid Dynamic Link

Open 24dev opened this issue 7 years ago • 12 comments

Issue

When opening Dynamic Links on a desktop device, they always take the user to 'Invalid Dynamic Link', like the attached screenshot. However, the links work as expected in all mobile devices. Is there any way to manually fix this?

Screen Shot 2019-09-12 at 10 51 39

Project Files

iOS

Click To Expand

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
pod 'Firebase/Core', '~> 5.15.0'
  pod 'Firebase/Firestore', '~> 5.15.0'
  pod 'Firebase/Storage', '~> 5.15.0'
  pod 'Firebase/Functions', '~> 5.15.0'
  pod 'Firebase/Messaging', '~> 5.15.0'
  pod 'Firebase/Auth', '~> 5.15.0'
  pod 'Firebase/Database', '~> 5.15.0'
  pod 'Firebase/DynamicLinks', '~> 5.15.0'

AppDelegate.m:

#import "AppDelegate.h"
#import "RNFirebaseLinks.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Firebase.h>
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"
#import <React/RCTLinkingManager.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<NSString *, id> *)options {
    return [[RNFirebaseLinks instance] application:application openURL:url options:options];
}

- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
 restorationHandler:(void (^)(NSArray *))restorationHandler {
  return [[RNFirebaseLinks instance] application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  [FIROptions defaultOptions].deepLinkURLScheme = @"MANGOES_LINK";
  [RNFirebaseNotifications configure];
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"Mangoes"
                                            initialProperties:nil];


  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
                                                       fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
  [[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
  [[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
}




@end


Android

Click To Expand

Have you converted to AndroidX?

  • [ ] my application is an AndroidX application?
  • [ ] I am using android/gradle.settings jetifier=true for Android compatibility?
  • [ ] I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • [] iOS
    • [ ] Android
    • [ ] iOS but have not tested behavior on Android
    • [ ] Android but have not tested behavior on iOS
    • [x] Both
  • react-native-firebase version you're using that has this issue:
    • 5.2.3
  • Firebase module(s) you're using that has the issue:
    • Dynamic Links
  • Are you using TypeScript?
    • N


Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

24dev avatar Sep 10 '19 09:09 24dev

When opening this page in debug mode, I am met with these errors:

Screen Shot 2019-09-12 at 11 48 08

24dev avatar Sep 12 '19 10:09 24dev

To fix the first error, maybe I am building the link wrong. Could somebody please advise whether this is the correct structure for the link param in firebase.links.DynamicLink()?

const link = new firebase.links.DynamicLink(
    `https://example.page.link?screen=${screen}&id=${id}`,
    'example.page.link',
  );

// ...do IOS & Android specific things

return firebase
    .links()
    .createShortDynamicLink(link, 'SHORT')
    .then(url => url);

An example in the documentation would definitely be helpful. https://rnfirebase.io/docs/v5.x.x/links/reference/DynamicLink

24dev avatar Sep 12 '19 11:09 24dev

I wouldn't spend any time troubleshooting anything on firebase ios sdk version 5.whatever. They are on 6.8 now and links are something they specifically changed. Get current (RN60.5 + RNFB5.5.6 + Pods 6.8) and retry

mikehardy avatar Sep 12 '19 13:09 mikehardy

Hello 👋, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 10 '19 13:10 stale[bot]

Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information.

stale[bot] avatar Oct 25 '19 14:10 stale[bot]

I'm having the same issue. RN61.2, + RNFB 6.1.0 + Pods 6.13

@24dev did you find a solution?

ammichael avatar Nov 28 '19 01:11 ammichael

@ammichael Unfortunately not, but we didn't investigate much further. Since you are experiencing this with the new versions, it should probably be reopened.

24dev avatar Nov 28 '19 08:11 24dev

Hello.

I'm have the same issue. This happend from iOS and Android. RN 61.5 + RNFB 5.6.0

@ammichael did you find a solution?

Thanks

elwla avatar Jan 29 '20 20:01 elwla

@24dev did you found any solution?

thilinawarnakula avatar Jun 29 '20 16:06 thilinawarnakula

@elwla any solution ??

thilinawarnakula avatar Jul 31 '20 10:07 thilinawarnakula

Never found a solution. Please open a new bug with the new v6 if it's happening to you @thilinawarnakula

24dev avatar Jul 31 '20 10:07 24dev

@24dev i was receiving the same error with my custom domain and after i setup equals of https://firebase.google.com/docs/dynamic-links/custom-domains was solved

pedrohsampaioo avatar Sep 13 '22 15:09 pedrohsampaioo