Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="dnd-master-58fca.web.app" android:pathPrefix="/app/" android:scheme="https"/>
</intent-filter>
<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:scheme="wfrp-master"/>
</intent-filter>
</activity>
</application>
</manifest>
1 change: 0 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ kotlin {

// Authentication
api(libs.play.services.auth)
implementation(libs.firebase.dynamic.links.ktx)

// Shared Preferences DataStore
api(libs.datastore.preferences)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.style.TextAlign
import androidx.core.net.toUri
import com.google.firebase.dynamiclinks.ktx.androidParameters
import com.google.firebase.dynamiclinks.ktx.dynamicLinks
import com.google.firebase.dynamiclinks.ktx.shortLinkAsync
import com.google.firebase.ktx.Firebase
import cz.frantisekmasa.wfrp_master.common.Str
import cz.frantisekmasa.wfrp_master.common.core.domain.party.Invitation
import cz.frantisekmasa.wfrp_master.common.core.logging.Reporting
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.FullScreenProgress
import cz.frantisekmasa.wfrp_master.common.core.ui.primitives.VISUAL_ONLY_ICON_DESCRIPTION
import dev.icerock.moko.resources.compose.stringResource
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.tasks.await
import kotlinx.coroutines.withContext

@Composable
Expand Down Expand Up @@ -74,15 +68,10 @@ private suspend fun buildSharingOptions(
): SharingOptions {
return withContext(Dispatchers.IO) {
val json = screenModel.serializeInvitation(invitation)
val link =
Firebase.dynamicLinks.shortLinkAsync {
link = InvitationLinkScreen.deepLink(json).toString().toUri()
androidParameters { }
domainUriPrefix = "https://wfrp.page.link"
}
val link = InvitationLinkScreen.deepLink(json).toString()

SharingOptions(
link = link.await().shortLink.toString(),
link = link,
json = json,
)
}
Expand Down
2 changes: 0 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ datastore-preferences = "1.1.2"
datetime-dialog = "0.5.1"
debounce = "1.2.0"
desugar-jdk-libs = "2.1.4"
firebase-dynamic-links-ktx = "22.1.0"
gitlive-firebase = "2.1.0"
google-services = "4.4.2"
junit-jupiter-engine = "5.8.2"
Expand Down Expand Up @@ -58,7 +57,6 @@ debounce = { module = "io.github.mmolosay:debounce", version.ref = "debounce" }
desugar-jdk-libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar-jdk-libs" }
firebase-auth = { module = "dev.gitlive:firebase-auth", version.ref = "gitlive-firebase" }
firebase-common = { module = "dev.gitlive:firebase-common", version.ref = "gitlive-firebase" }
firebase-dynamic-links-ktx = { module = "com.google.firebase:firebase-dynamic-links-ktx", version.ref = "firebase-dynamic-links-ktx" }
firebase-analytics = { module = "dev.gitlive:firebase-analytics", version.ref = "gitlive-firebase" }
firebase-crashlytics = { module = "dev.gitlive:firebase-crashlytics", version.ref = "gitlive-firebase" }
firebase-firestore = { module = "dev.gitlive:firebase-firestore", version.ref = "gitlive-firebase" }
Expand Down
14 changes: 14 additions & 0 deletions webapp/.well-known/assetlinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "cz.frantisekmasa.dnd",
"sha256_cert_fingerprints": [
"E2:C6:D6:EC:B9:ED:D4:ED:BE:0B:98:3A:69:9D:70:EB:95:71:C0:6F:7E:A1:CB:FF:6D:92:75:80:8F:80:CE:1B"
]
}
}
]
4 changes: 4 additions & 0 deletions webapp/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ body {
clear: both;
}

.text-center {
text-align: center;
}

@media (max-width: 600px) {
body, #message {
margin-top: 0;
Expand Down
20 changes: 10 additions & 10 deletions webapp/app/invitation.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,25 @@
<div id="header">
<h1>WFRP Master</h1>
</div>
<div id="message">
<div class="main-screenshot">
<img src="/screenshot.png" alt="Screenshot of WFRP Master" style="width: 100%">
<a href="https://play.google.com/store/apps/details?id=cz.frantisekmasa.dnd&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"><img
alt="Get it on Google Play"
width="200"
src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png"/></a>
</div>
<div id="message" class="text-center">
<h1>Invitation</h1>
<p>You have been invited to WFRP Master party.</p>
<p>Open this page on your Android device to join it, or scan QR code below in WFRP Master app.</p>
<div id="qrCode" style="margin: auto; width: 200px"></div>
<div class="clear"></div>
<p>If you are visiting this page on your Android device and the app did not open <a id="open-app" href="">click here</a>.</p>
<p>If you don't have the app installed yet, you can <a href="https://play.google.com/store/apps/details?id=cz.frantisekmasa.dnd&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1">install it from Google Play</a>.</p>
<a href="https://play.google.com/store/apps/details?id=cz.frantisekmasa.dnd&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1"><img
alt="Get it on Google Play"
width="200"
src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png"/></a>
</div>
<div id="footer">
<p>WFRP Master</p>
<p>Google Play and the Google Play logo are trademarks of Google LLC.</p>
<a href="/privacy-policy.html">Privacy Policy</a>
</div>
<script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>
<script>
<script type="text/javascript">
const urlParams = new URLSearchParams(window.location.search);
const invitation = urlParams.get('invitation');

Expand All @@ -40,6 +38,8 @@ <h1>Invitation</h1>
width: 200,
height: 200,
});

document.getElementById("open-app").href = "wfrp-master://invitation?invitation=" + encodeURIComponent(invitation);
</script>
</body>
</html>
Loading