diff --git a/app/android/app/src/main/AndroidManifest.xml b/app/android/app/src/main/AndroidManifest.xml index 90eaeddb..a4f22503 100644 --- a/app/android/app/src/main/AndroidManifest.xml +++ b/app/android/app/src/main/AndroidManifest.xml @@ -37,6 +37,18 @@ + + + + + + + + + + + + 'Please open the $shareAppName and share your data with PharMe'; + Future _waitForDeepLinkSharePublishUrl() async { + var waitingForDeepLinkSharePublishUrl = true; + while (waitingForDeepLinkSharePublishUrl) { + waitingForDeepLinkSharePublishUrl = + MetaData.instance.deepLinkSharePublishUrl == null; + await Future.delayed(Duration(seconds: 1)); + } + } + @override Future authenticate() async { - // THIS IS FOR TESTING, SHOULD WAIT UNTIL A DEEP LINK IS RECEIVED - // (if possible like this but could set metadata field when deep link - // caught and wait here until it was set) - await Future.delayed(Duration(seconds: 7)); + await _waitForDeepLinkSharePublishUrl(); } @override Future<(List, List)> loadData() async { - // THIS IS FOR TESTING, SHOULD GET FROM DWA publishUrl = Uri.parse( - 'https://hpi-datastore.duckdns.org/userdata?id=1e006a69-b693-43d2-a318-22904e305b5c', + MetaData.instance.deepLinkSharePublishUrl!, ); publishHeaders = null; return fetchData( diff --git a/pharme.code-workspace b/pharme.code-workspace index bfcd09fc..1d37b242 100644 --- a/pharme.code-workspace +++ b/pharme.code-workspace @@ -60,6 +60,7 @@ "drugclass", "drugid", "drugrecommendation", + "drugselection", "duckdns", "duloxetine", "endoxifen",