I struggled with dynamic links for days. Appreciate any help, please. I integrate firebase dynamic links, if I paste the link in chrome url and press enter, it can open app with event triggered and url passed but if I click the open button on the preview page, it always open App store regardless whether the app installed or not Any thoughts?
I have browsed all posts on the web, but no good luck.
"react-native": "^0.59.5"
"react-native-firebase": "^5.3.1"
pod 'Firebase/Core', '~> 5.20.1'
pod 'Firebase/DynamicLinks', '~> 5.20.1'
Domain on firebase console: https://links.umrgo.com/links
bundle id: com.umrgo.www.umr-app-ios
URL Types identifier: links.umrgo.com
URL Types identifier: com.umrgo.www.umr-app-ios
capabilities: applinks:links.umrgo.com
release build
I also add FirebaseDynamicLinksCustomDomains with a array of string https://links.umrgo.com
Some of my codes are as below.
[FIROptions defaultOptions].deepLinkURLScheme = @"com.umrgo.www.umr-app-ios";
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
options:(NSDictionary<NSString*, id> *)options
{
BOOL handled = [[RNFirebaseLinks instance]
application:application
openURL:url
options:options
] || [RCTLinkingManager
application:application
openURL:url
options:options
];
return handled;
}
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *))restorationHandler {
BOOL handled = [[RNFirebaseLinks instance]
application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler
] || [RCTLinkingManager
application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler
];
return handled;
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
BOOL handled = [RCTLinkingManager
application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
return handled;
}
const link = new firebase.links.DynamicLink(`https://www.umrgo.com/publish/${publishId}?publishType=${publishType}&publishId=${publishId}&otherUserUnionId=${currentUserUnionId}&conversationId=${conversationId}`,
'links.umrgo.com/links').android.setPackageName(conf.GooglePackageName).ios.setBundleId(conf.AppleBundleId).ios.setAppStoreId(conf.AppleAppID);
firebase.links()
.createShortDynamicLink(link, 'UNGUESSABLE')
.then((url) => {
var payload = {
key: createLinkUniqueKey(conversationId, publishId, currentUserUnionId, publishType),
url: url,
publish_id: publishId,
target_user_unionid: currentUserUnionId,
conversation_id: conversationId,
publish_type: publishType
}
axios.post(getApiEndpoint(conf.UMRApiUrls.createDynamicLinkRemote), payload, {
headers: getAuthHeader()
}).then(response => {
console(response)
})
});
Some snapshots are below:
enter link in browser and press enter