Closed azazadev closed 2 years ago
@azazadev
Can you provide the entire error log when you try to access the link from ios to android ?
Also, while doing so, does getInitialLink()
shows any data or is null ?
Thanks @darshankawar for the quick replay !
I don't know how we can get error because the app is not launched in case of Android
take this simple scenario
User A ( Iphone ) share the post link to User B ( Iphone ) and User C ( Andoid ) via WhatApp ( example : https://myappname.page.link/aBCD )
User B ( Iphone ) receive WhatApp Message with Link https://myappname.page.link/aBCD and clic on the Link --> app will be launched and we receive the post id as expected in the UI
User C ( Andoid ) receive WhatApp Message with Link https://myappname.page.link/aBCD and clic on the Link --> what we observe is Loading indicator for 1 or 2 second after the browser is launched on the URL https://myappname.app/postId with 404 error --> so the app is not launched so I cannot know what is the error ( please let me know if I can do something to debug it )
NOTE : this code is not executed in case of Andoid so we cannot know if the getInitialLink have data or not
code to handle DynamicLinks
Future handleDynamicLinks() async {
final PendingDynamicLinkData data = await dynamicLinks.getInitialLink();
await _handleDeepLink(data);
dynamicLinks.onLink.listen((dynamicLinkData) async {
_handleDeepLink(dynamicLinkData);
}).onError((error) {
logger.e('Link Failed: ${error.message}');
});
}
Future<void> _handleDeepLink(PendingDynamicLinkData data) async {
final Uri deepLink = data?.link;
if (deepLink != null) {
var isPost = deepLink.pathSegments.length == 1;
if (isPost && _authenticationService.currentUser != null) {
var postId = deepLink.pathSegments.first;
if (postId != null) {
// postId received successfully !!
}
}
}
}
please let me know if you need any additional infos
I'm able to progress on this issue but I'm not convinced about the solution !
Finding
as from documentation we should Add deep link domains in AndroidManifest.xml as below
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:host="example.com"
android:scheme="https"/>
</intent-filter>
in my case android:host="myappname.app"
but from this link android:host is equals to the page.link in my case this should be myappname.page.link
so in AndroidManifest.xml I update
from <data android:host="myappname.app" android:scheme="https"/>
to <data android:host="myappname.page.link" android:scheme="https"/>
New Test
try to open the same link sent from IOS
Observed :
new bottom sheet menu with :
Complete Action using
myApp Chrome Browser
app is launched and postId is successfully received
NOTE :
so can someone confirm what is the impact of changing the android:host in AndroidManifest.xml from myappname.app to myappname.page.link ? should I go with this change ?
how I can force opening the link with myApp and not with browser ( programmatically because inside the Firebase Console I thik this option exist "Open the deep link in your Android App" ) ?
should I go with this change ?
Thanks for the details and updates. According to the official document on setup, it does mention to add the deep link domains to manifest file: https://firebase.flutter.dev/docs/dynamic-links/android-integration#androidmanifestxml-configuration
how I can force opening the link with myApp and not with browser ( programmatically because inside the Firebase Console I thik this option exist "Open the deep link in your Android App" ) ?
If you select app from bottom sheet (shown on some android phones), does it open the app ?
in Firebase console: do you have the same setting as below:
If so, it may be a different issue to tackle and may need to open a new for better tracking.
If you select app from bottom sheet (shown on some android phones), does it open the app
yes
in Firebase console: do you have the same setting as below
Yes, I check for both I can select my Android app and IOS app
NOTE : we should not forget that link work from
only IPhone to Android we have the issue
I have try to collect more information, so I create link with the same postId on Iphone and Android, so the output of the createPostLink method with postId ( example : 3cjsRsTIicIaVK2anA5x ) is :
Iphone : https://myappname.page.link/abcd Android : https://myappname.page.link/efgh
so I have try to debug those link by adding param d=1
for Iphone this is the debug output for URL https://myappname.page.link/abcd?d=1
The dynamic link has 2 warning(s)
We could not find Android package name 'com.mydomain.myapp.xxxx' in this Google project. Learn more.
There is no configuration to prevent phishing on this domain https://myappname.page.link. Setup URL patterns to whitelist in the Firebase Dynamic Links console. Learn more.
for Andoid this is the debug output for URL https://myappname.page.link/efgh?d=1
The dynamic link has 2 warning(s)
We could not find bundle ID 'com.mydomain.myapp.xxxx' in this Google project. Learn more.
There is no configuration to prevent phishing on this domain https://myappname.page.link. Setup URL patterns to whitelist in the Firebase Dynamic Links console. Learn more.
@darshankawar hope this can help you to find something :)
Thanks for the update. Keeping it open for further investigation from the team. /cc @russellwheatley
Hey @azazadev, I've just tested creating a short dynamic link on iOS which opened my app. I then used the same link to open my android app and it worked. I used the example app code here.
I would advise building in release mode for it to work though (i.e. flutter run --release
). Could you try and let me know if it works? Thanks
Hey @azazadev. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Hey @azazadev, I've just tested creating a short dynamic link on iOS which opened my app. I then used the same link to open my android app and it worked. I used the example app code here.
I would advise building in release mode for it to work though (i.e.
flutter run --release
). Could you try and let me know if it works? Thanks
Thanks @russellwheatley , i will try to test again when i have some time. Issue can be closed if no answer from my side
Since there haven't been any recent updates here, I am going to close this issue.
@azazadev if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.
Problem Description
In my flutter app I'm using firebase_dynamic_links: ^4.0.3 to share posts between users
I don't know if this can be the problem but the generated Link is not the same on Iphone and Android
for example with the same post ID the generated link will be :
Iphone 6 : https://myappname.page.link/aBCD
Iphone 7 : https://myappname.page.link/aBCD
Iphone11 : https://myappname.page.link/aBCD
huawei android : https://myappname.page.link/zFGH
Samsung android : https://myappname.page.link/pHTU
OBSERVED :
EXPECTED : Link should work also on Andoid when it's sent from Iphone
code used to create Link :
flutter doctor
please help fixing this issue !!