You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Android 8.0.0 (API 26) , I have been experiencing a strange problem.
The getInitialLink() continues to give a valid dynamic link after the first retrieval.
This leads to a loop where a user is continuously forced into a page associated with
the deep link.
Running flutter doctor --verbose produced below results.
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-US)
• Flutter version 1.20.4 at /Users/sjsam/Documents/Developement/flutter
• Framework revision fba99f6cf9 (5 days ago), 2020-09-14 15:32:52 -0700
• Engine revision d1bc06f032
• Dart version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/sjsam/Library/Android/sdk
• Platform android-29, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.0
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (2 available)
• AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator) # No issues here
• Android SDK built for x86 (mobile) • emulator-5556 • android-x86 • Android 8.0.0 (API 26) (emulator) # Issue happens here
• No issues found!
My code sample (which is mostly of a copy of the code given in the documentation is given below.
@override
void initState() {
super.initState();
this.initDynamicLinks();
}
void initDynamicLinks() async {
try {
FirebaseDynamicLinks.instance.onLink(onSuccess: (PendingDynamicLinkData dynamicLink) async {
var deepLink = dynamicLink?.link?.toString() ?? null;
if (null != deepLink ) {
// A bit of reverse engineering here
var lastIndex = deepLink.lastIndexOf(RegExp(r'/'));
assert(lastIndex != -1, "Problematic Link");
var feedId = deepLink.substring(lastIndex + 1);
// At this point, we're interested in dynamicURLPath.
// We wish to use this to navigate to Order Submission Page somehow.
var feedInfo = await DatabaseService.getFeedOwner(feedID: feedId);
// On getting the customer UID, we need to load the burst feed itself using the customer UID
var burstFeed = await DatabaseService.getBurstFeedForImmediateNavigation(
customerUID: feedInfo['customer_id'],
orderNumber: feedInfo['order_number'],
);
try {
await Navigator.of(this.context).pushNamedAndRemoveUntil(
DeliveryTakeOrder.page,
ModalRoute.withName(PAGENAME),
arguments: argumentsConstructor(/*Arguments Here*/),
);
} catch (e) {
if (!kReleaseMode) {
debugPrint(e.toString());
}
}
}
}, onError: (OnLinkErrorException e) async {
print('onLinkError');
print(e.message);
});
} catch (e, s) {
print(s);
}
// await FirebaseDynamicLinks.instance.
final PendingDynamicLinkData dynamicLink = await FirebaseDynamicLinks.instance.getInitialLink();
var deepLink = dynamicLink?.link?.toString() ?? null;
if (null != deepLink ) {
// A bit of reverse engineering here
var lastIndex = deepLink.lastIndexOf(RegExp(r'/'));
assert(lastIndex != -1, "Problematic Link");
var feedId = deepLink.substring(lastIndex + 1);
// At this point, we're interested in dynamicURLPath.
// We wish to use this to navigate to Order Submission Page somehow.
var feedInfo = await DatabaseService.getFeedOwner(feedID: feedId);
// On getting the customer UID, we need to load the burst feed itself using the customer UID
var burstFeed = await DatabaseService.getBurstFeedForImmediateNavigation(
customerUID: feedInfo['customer_id'],
orderNumber: feedInfo['order_number'],
);
try {
await Navigator.of(this.context).pushNamedAndRemoveUntil(
DeliveryTakeOrder.page,
ModalRoute.withName(PAGENAME),
arguments: argumentsConstructor(/*Arguments Here*/),
);
} catch (e) {
if (!kReleaseMode) {
debugPrint(e.toString());
}
}
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For Android 8.0.0 (API 26) , I have been experiencing a strange problem.
The
getInitialLink()
continues to give a valid dynamic link after the first retrieval.This leads to a loop where a user is continuously forced into a page associated with
the deep link.
Running
flutter doctor --verbose
produced below results.My code sample (which is mostly of a copy of the code given in the documentation is given below.
Beta Was this translation helpful? Give feedback.
All reactions