Compare commits

..

1 Commits

Author SHA1 Message Date
Matthew Raymer
cd32c37cfb fix: standardize app package name to app.timesafari.app
Update package name consistently across all configurations to fix deep linking and app identification issues.

Changes:
- Update appId in package.json build config from "app.timesafari" to "app.timesafari.app"
- Update force-stop commands in test scripts to use correct package name
- Update URL scheme registration in iOS Info.plist to use consistent bundle ID
- Update app identifier fallback values in iOS test script
- Update serve script to use production mode with host flag

Technical Details:
- Standardized package name to "app.timesafari.app" across all configurations
- Fixed ADB commands in test scripts to use correct package identifier
- Updated iOS URL scheme registration to match Android package name
- Added proper NODE_ENV and host configuration for serve command

Benefits:
- Fixes deep linking functionality by using consistent package identifiers
- Ensures correct app identification across Android and iOS platforms
- Improves test reliability with correct package references
- Enables proper cross-platform URL scheme handling
2025-03-25 08:53:24 +00:00
13 changed files with 907 additions and 699 deletions

View File

@@ -442,13 +442,13 @@ mv time-safari/dist time-safari-dist-prev.0 && mv crowd-funder-for-time-pwa/dist
adb shell pm list packages | grep timesafari
# Force stop the app (if it's running)
adb shell am force-stop app.timesafari
adb shell am force-stop app.timesafari.app
# Clear app data (if you don't want to fully uninstall)
adb shell pm clear app.timesafari
adb shell pm clear app.timesafari.app
# Uninstall for all users
adb shell pm uninstall -k --user 0 app.timesafari
adb shell pm uninstall -k --user 0 app.timesafari.app
# Check if app is installed
adb shell pm path app.timesafari
adb shell pm path app.timesafari.app

Binary file not shown.

View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title>TimeSafari</title>
<script type="module" crossorigin src="/assets/index-CZMUlUNO.js"></script>
<script type="module" crossorigin src="/assets/index-DHTxVcAY.js"></script>
</head>
<body>
<noscript>

1455
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
},
"scripts": {
"dev": "vite --config vite.config.dev.mts",
"serve": "vite preview",
"serve": "NODE_ENV=production vite preview --mode production --host",
"build": "VITE_GIT_HASH=`git log -1 --pretty=format:%h` vite build --config vite.config.mts",
"lint": "eslint --ext .js,.ts,.vue --ignore-path .gitignore src",
"lint-fix": "eslint --ext .js,.ts,.vue --ignore-path .gitignore --fix src",
@@ -155,7 +155,7 @@
},
"main": "./dist-electron/main.js",
"build": {
"appId": "app.timesafari",
"appId": "app.timesafari.app",
"productName": "TimeSafari",
"directories": {
"output": "dist-electron-packages"

View File

@@ -170,7 +170,7 @@ const executeDeeplink = async (url, description, log) => {
try {
// Stop the app before executing the deep link
execSync('adb shell am force-stop app.timesafari');
execSync('adb shell am force-stop app.timesafari.app');
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait 1s
execSync(`adb shell am start -W -a android.intent.action.VIEW -d "${url}" -c android.intent.category.BROWSABLE`);
@@ -207,10 +207,6 @@ const runDeeplinkTests = async (log) => {
// Test URLs
const deeplinkTests = [
{
url: `timesafari://claim/${claimDetails.claim_id}`,
description: 'Claim view'
},
{
url: `timesafari://claim-cert/${claimDetails.claim_id}`,
description: 'Claim certificate view'

View File

@@ -800,7 +800,7 @@ const checkAndRegisterUrlScheme = (log) => {
<array>
<dict>
<key>CFBundleURLName</key>
<string>app.timesafari</string>
<string>app.timesafari.app</string>
<key>CFBundleURLSchemes</key>
<array>
<string>timesafari</string>
@@ -855,10 +855,10 @@ const getAppIdentifier = () => {
}
// Default fallback
return 'app.timesafari';
return 'app.timesafari.app';
} catch (error) {
console.error('Error getting app identifier:', error);
return 'app.timesafari'; // Default fallback
return 'app.timesafari.app'; // Default fallback
}
};

View File

@@ -13,12 +13,15 @@
<div class="bg-slate-100 rounded-t-md border border-slate-300 p-3 sm:p-4">
<div class="flex items-center gap-2 mb-6">
<EntityIcon
:entity-id="record.issuerDid"
:profile-image-url="record.issuer.profileImageUrl"
:icon-size="24"
class="rounded object-cover"
/>
<div v-if="record.issuerDid">
<EntityIcon
:entity-id="record.issuerDid"
class="rounded size-[3rem] sm:size-[4rem] object-cover"
/>
</div>
<div v-else>
<font-awesome icon="person-circle-question" class="text-slate-300 text-[3rem] sm:text-[4rem]" />
</div>
<div>
<h3 class="font-semibold">
@@ -51,9 +54,8 @@
</a>
</div>
<!-- Giver - - > Receiver -->
<div class="relative flex justify-between gap-4 max-w-lg mx-auto mb-5">
<!-- Giver -->
<!-- Source -->
<div
class="w-28 sm:w-40 text-center bg-white border border-slate-200 rounded p-2 sm:p-3"
>
@@ -64,17 +66,24 @@
<ProjectIcon
:entity-id="record.providerPlanName"
:icon-size="48"
class="rounded *:w-full *:h-full"
class="rounded size-[3rem] sm:size-[4rem] *:w-full *:h-full"
/>
</div>
<!-- Identicon for DIDs -->
<EntityIcon
v-else
:entity-id="record.agentDid"
:profile-image-url="record.issuer.profileImageUrl"
:icon-size="48"
class="rounded size-[3rem] sm:size-[4rem]"
/>
<div v-else-if="record.agentDid">
<EntityIcon
:entity-id="record.agentDid"
:profile-image-url="record.issuer.profileImageUrl"
class="rounded size-[3rem] sm:size-[4rem]"
/>
</div>
<!-- Unknown Person -->
<div v-else>
<font-awesome
icon="person-circle-question"
class="text-slate-300 text-[3rem] sm:text-[4rem]"
/>
</div>
</div>
</div>
<div class="text-xs mt-2 line-clamp-3 sm:line-clamp-2">
@@ -107,7 +116,7 @@
</div>
</div>
<!-- Recipient -->
<!-- Destination -->
<div
class="w-28 sm:w-40 text-center bg-white border border-slate-200 rounded p-2 sm:p-3"
>
@@ -122,13 +131,20 @@
/>
</div>
<!-- Identicon for DIDs -->
<EntityIcon
v-else
:entity-id="record.recipientDid"
:profile-image-url="record.receiver.profileImageUrl"
:icon-size="48"
class="rounded size-[3rem] sm:size-[4rem]"
/>
<div v-else-if="record.recipientDid">
<EntityIcon
:entity-id="record.recipientDid"
:profile-image-url="record.receiver.profileImageUrl"
class="rounded size-[3rem] sm:size-[4rem]"
/>
</div>
<!-- Unknown Person -->
<div v-else>
<font-awesome
icon="person-circle-question"
class="text-slate-300 text-[3rem] sm:text-[4rem]"
/>
</div>
</div>
</div>
<div class="text-xs mt-2 line-clamp-3 sm:line-clamp-2">

View File

@@ -1,45 +1,29 @@
<template>
<div class="w-fit">
<font-awesome
v-if="!this.contact?.did && !this.entityId"
icon="person-circle-question"
:class="`fa-fw text-slate-400`"
:style="{ width: `${this.iconSize}px`, height: `${this.iconSize}px` }"
/>
<font-awesome
v-else-if="isHiddenDid"
icon="eye-slash"
:class="`fa-fw text-slate-400`"
:style="{ width: `${this.iconSize}px`, height: `${this.iconSize}px` }"
/>
<div v-else v-html="generateIcon()"></div>
</div>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="w-fit" v-html="generateIcon()"></div>
</template>
<script lang="ts">
import { createAvatar, StyleOptions } from "@dicebear/core";
import { avataaars } from "@dicebear/collection";
import { Vue, Component, Prop } from "vue-facing-decorator";
import { Contact } from "../db/tables/contacts";
import { isHiddenDid } from "@/libs/endorserServer";
@Component
export default class EntityIcon extends Vue {
@Prop contact: Contact = null;
@Prop contact: Contact;
@Prop entityId = ""; // overridden by contact.did or profileImageUrl
@Prop iconSize = 0;
@Prop profileImageUrl = ""; // overridden by contact.profileImageUrl
get isHiddenDid() {
const identifier = this.contact?.did || this.entityId;
return isHiddenDid(identifier);
}
generateIcon() {
const imageUrl = this.contact?.profileImageUrl || this.profileImageUrl;
if (imageUrl) {
return `<img src="${imageUrl}" class="rounded" width="${this.iconSize}" height="${this.iconSize}" />`;
} else {
const identifier = this.contact?.did || this.entityId;
if (!identifier) {
return `<img src="../src/assets/blank-square.svg" class="rounded" width="${this.iconSize}" height="${this.iconSize}" />`;
}
// https://api.dicebear.com/8.x/avataaars/svg?seed=
// ... does not render things with the same seed as this library.
// "did:ethr:0x222BB77E6Ff3774d34c751f3c1260866357B677b" yields a girl with flowers in her hair and a lightning earring

View File

@@ -492,6 +492,31 @@ export default class HomeView extends Vue {
}
}
// this returns a Promise but we don't need to wait for it
this.updateAllFeed();
if (this.activeDid) {
const offersToUserData = await getNewOffersToUser(
this.axios,
this.apiServer,
this.activeDid,
this.lastAckedOfferToUserJwtId,
);
this.numNewOffersToUser = offersToUserData.data.length;
this.newOffersToUserHitLimit = offersToUserData.hitLimit;
}
if (this.activeDid) {
const offersToUserProjects = await getNewOffersToUserProjects(
this.axios,
this.apiServer,
this.activeDid,
this.lastAckedOfferToUserProjectsJwtId,
);
this.numNewOffersToUserProjects = offersToUserProjects.data.length;
this.newOffersToUserProjectsHitLimit = offersToUserProjects.hitLimit;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {
logConsoleAndDb("Error retrieving settings or feed: " + err, true);

View File

@@ -74,7 +74,7 @@ execute_deeplink() {
echo "---"
else
# Stop the app before executing the deep link
adb shell am force-stop app.timesafari
adb shell am force-stop app.timesafari.app
sleep 1 # Give it a moment to fully stop
if adb shell am start -W -a android.intent.action.VIEW \

6
vite.config.js Normal file
View File

@@ -0,0 +1,6 @@
export default {
preview: {
host: true,
port: 4173
}
}