Compare commits
13 Commits
cross-plat
...
build-ios
| Author | SHA1 | Date | |
|---|---|---|---|
| ca455e9593 | |||
| 5ada70b05e | |||
|
|
4f9b146a66 | ||
|
|
2b638ce2a7 | ||
|
|
0b528af2a6 | ||
|
|
008211bc21 | ||
|
|
6955a36458 | ||
|
|
ba079ea983 | ||
|
|
d7b3c5ec9d | ||
|
|
d83a25f47e | ||
|
|
fb40dc0ff7 | ||
|
|
d03fa55001 | ||
|
|
c8eff4d39e |
@@ -215,6 +215,9 @@ Prerequisites: Android Studio with SDK installed
|
|||||||
rm -rf dist
|
rm -rf dist
|
||||||
npm run build:web
|
npm run build:web
|
||||||
npm run build:capacitor
|
npm run build:capacitor
|
||||||
|
cd android
|
||||||
|
./gradlew clean
|
||||||
|
./gradlew assembleDebug
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Update Android project with latest build:
|
2. Update Android project with latest build:
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#Fri Mar 21 07:27:50 UTC 2025
|
#Wed Apr 09 09:01:13 UTC 2025
|
||||||
gradle.version=8.2.1
|
gradle.version=8.11.1
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ project.ext.MY_KEY_PASSWORD = System.getenv('ANDROID_KEY_PASSWORD') ?: ""
|
|||||||
|
|
||||||
// If no environment variables, try to load from secrets file
|
// If no environment variables, try to load from secrets file
|
||||||
if (!project.ext.MY_KEYSTORE_FILE) {
|
if (!project.ext.MY_KEYSTORE_FILE) {
|
||||||
def secretsPropertiesFile = rootProject.file("gradle.properties.secrets")
|
def secretsPropertiesFile = rootProject.file("app/gradle.properties.secrets")
|
||||||
if (secretsPropertiesFile.exists()) {
|
if (secretsPropertiesFile.exists()) {
|
||||||
Properties secretsProperties = new Properties()
|
Properties secretsProperties = new Properties()
|
||||||
secretsProperties.load(new FileInputStream(secretsPropertiesFile))
|
secretsProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
@@ -31,7 +31,7 @@ android {
|
|||||||
applicationId "app.timesafari.app"
|
applicationId "app.timesafari.app"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 9
|
versionCode 10
|
||||||
versionName "0.4.4"
|
versionName "0.4.4"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ dependencies {
|
|||||||
implementation project(':capacitor-app')
|
implementation project(':capacitor-app')
|
||||||
implementation project(':capacitor-camera')
|
implementation project(':capacitor-camera')
|
||||||
implementation project(':capacitor-filesystem')
|
implementation project(':capacitor-filesystem')
|
||||||
|
implementation project(':capacitor-share')
|
||||||
|
implementation project(':capawesome-capacitor-file-picker')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
|
|||||||
// Context of the app under test.
|
// Context of the app under test.
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
|
||||||
assertEquals("app.timesafari", appContext.getPackageName());
|
assertEquals("app.timesafari.app", appContext.getPackageName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
@@ -8,7 +7,6 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||||
@@ -16,7 +14,6 @@
|
|||||||
android:label="@string/title_activity_main"
|
android:label="@string/title_activity_main"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/AppTheme.NoActionBarLaunch">
|
android:theme="@style/AppTheme.NoActionBarLaunch">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
@@ -28,7 +25,6 @@
|
|||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="timesafari" />
|
<data android:scheme="timesafari" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
@@ -36,13 +32,13 @@
|
|||||||
android:authorities="${applicationId}.fileprovider"
|
android:authorities="${applicationId}.fileprovider"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:grantUriPermissions="true">
|
android:grantUriPermissions="true">
|
||||||
<meta-data
|
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
|
||||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
||||||
android:resource="@xml/file_paths"></meta-data>
|
|
||||||
</provider>
|
</provider>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
<!-- Permissions -->
|
<!-- Permissions -->
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -10,5 +10,13 @@
|
|||||||
{
|
{
|
||||||
"pkg": "@capacitor/filesystem",
|
"pkg": "@capacitor/filesystem",
|
||||||
"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
|
"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pkg": "@capacitor/share",
|
||||||
|
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pkg": "@capawesome/capacitor-file-picker",
|
||||||
|
"classpath": "io.capawesome.capacitorjs.plugins.filepicker.FilePickerPlugin"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<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>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong>We're sorry but TimeSafari doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
||||||
</noscript>
|
|
||||||
<div id="app"></div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 23 KiB |
@@ -2,4 +2,5 @@
|
|||||||
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
<paths xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<external-path name="my_images" path="." />
|
<external-path name="my_images" path="." />
|
||||||
<cache-path name="my_cache_images" path="." />
|
<cache-path name="my_cache_images" path="." />
|
||||||
|
<files-path name="my_files" path="." />
|
||||||
</paths>
|
</paths>
|
||||||
@@ -7,7 +7,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.9.0'
|
classpath 'com.android.tools.build:gradle:8.9.1'
|
||||||
classpath 'com.google.gms:google-services:4.4.0'
|
classpath 'com.google.gms:google-services:4.4.0'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
|||||||
@@ -10,3 +10,9 @@ project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/c
|
|||||||
|
|
||||||
include ':capacitor-filesystem'
|
include ':capacitor-filesystem'
|
||||||
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
|
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
|
||||||
|
|
||||||
|
include ':capacitor-share'
|
||||||
|
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')
|
||||||
|
|
||||||
|
include ':capawesome-capacitor-file-picker'
|
||||||
|
project(':capawesome-capacitor-file-picker').projectDir = new File('../node_modules/@capawesome/capacitor-file-picker/android')
|
||||||
|
|||||||
27
ios/.gitignore
vendored
@@ -1,23 +1,16 @@
|
|||||||
App/build
|
App/build
|
||||||
App/Pods
|
|
||||||
App/output
|
App/output
|
||||||
App/App/public
|
App/Pods
|
||||||
DerivedData
|
|
||||||
xcuserdata
|
App/*.xcodeproj/xcuserdata/
|
||||||
*.xcuserstate
|
App/*.xcworkspace/xcuserdata/
|
||||||
|
App/*/public
|
||||||
|
|
||||||
|
# Generated Config files
|
||||||
|
App/*/capacitor.config.json
|
||||||
|
App/*/config.xml
|
||||||
|
|
||||||
# Cordova plugins for Capacitor
|
# Cordova plugins for Capacitor
|
||||||
capacitor-cordova-ios-plugins
|
capacitor-cordova-ios-plugins
|
||||||
|
|
||||||
# Generated Config files
|
DerivedData
|
||||||
App/App/capacitor.config.json
|
|
||||||
App/App/config.xml
|
|
||||||
|
|
||||||
# User-specific Xcode files
|
|
||||||
App/App.xcodeproj/xcuserdata/*.xcuserdatad/
|
|
||||||
App/App.xcodeproj/*.xcuserstate
|
|
||||||
|
|
||||||
fastlane/report.xml
|
|
||||||
fastlane/Preview.html
|
|
||||||
fastlane/screenshots
|
|
||||||
fastlane/test_output
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
|
2BC611FE3D7967BDB623FF21 /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E0C2082015AEE6A0776A3EAB /* Pods_App.framework */; };
|
||||||
2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; };
|
2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; };
|
||||||
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; };
|
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; };
|
||||||
504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; };
|
504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; };
|
||||||
@@ -14,21 +15,22 @@
|
|||||||
504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; };
|
504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; };
|
||||||
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
|
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
|
||||||
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
|
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
|
||||||
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
|
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
|
||||||
50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = "<group>"; };
|
50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = "<group>"; };
|
||||||
504EC3041FED79650016851F /* Time Safari.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Time Safari.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
|
50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
|
||||||
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
821226CEE4D47A540167CC8F /* Pods-Time Safari.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Time Safari.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Time Safari/Pods-Time Safari.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = "<group>"; };
|
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
E0C2082015AEE6A0776A3EAB /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
EF03C3F99471948925ED5AC3 /* Pods-Time Safari.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Time Safari.release.xcconfig"; path = "Pods/Target Support Files/Pods-Time Safari/Pods-Time Safari.release.xcconfig"; sourceTree = "<group>"; };
|
||||||
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
|
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
@@ -37,7 +39,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */,
|
2BC611FE3D7967BDB623FF21 /* Pods_App.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -47,7 +49,7 @@
|
|||||||
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = {
|
27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */,
|
E0C2082015AEE6A0776A3EAB /* Pods_App.framework */,
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -65,7 +67,7 @@
|
|||||||
504EC3051FED79650016851F /* Products */ = {
|
504EC3051FED79650016851F /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
504EC3041FED79650016851F /* Time Safari.app */,
|
504EC3041FED79650016851F /* App.app */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -90,6 +92,8 @@
|
|||||||
children = (
|
children = (
|
||||||
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */,
|
FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */,
|
||||||
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */,
|
AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */,
|
||||||
|
821226CEE4D47A540167CC8F /* Pods-Time Safari.debug.xcconfig */,
|
||||||
|
EF03C3F99471948925ED5AC3 /* Pods-Time Safari.release.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
name = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -97,9 +101,9 @@
|
|||||||
/* End PBXGroup section */
|
/* End PBXGroup section */
|
||||||
|
|
||||||
/* Begin PBXNativeTarget section */
|
/* Begin PBXNativeTarget section */
|
||||||
504EC3031FED79650016851F /* Time Safari */ = {
|
504EC3031FED79650016851F /* App */ = {
|
||||||
isa = PBXNativeTarget;
|
isa = PBXNativeTarget;
|
||||||
buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "Time Safari" */;
|
buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */,
|
6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */,
|
||||||
504EC3001FED79650016851F /* Sources */,
|
504EC3001FED79650016851F /* Sources */,
|
||||||
@@ -111,9 +115,9 @@
|
|||||||
);
|
);
|
||||||
dependencies = (
|
dependencies = (
|
||||||
);
|
);
|
||||||
name = "Time Safari";
|
name = App;
|
||||||
productName = App;
|
productName = "Time Safari";
|
||||||
productReference = 504EC3041FED79650016851F /* Time Safari.app */;
|
productReference = 504EC3041FED79650016851F /* App.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
@@ -122,8 +126,8 @@
|
|||||||
504EC2FC1FED79650016851F /* Project object */ = {
|
504EC2FC1FED79650016851F /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastSwiftUpdateCheck = 0920;
|
LastSwiftUpdateCheck = 920;
|
||||||
LastUpgradeCheck = 0920;
|
LastUpgradeCheck = 920;
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
504EC3031FED79650016851F = {
|
504EC3031FED79650016851F = {
|
||||||
CreatedOnToolsVersion = 9.2;
|
CreatedOnToolsVersion = 9.2;
|
||||||
@@ -132,7 +136,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "Time Safari" */;
|
buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */;
|
||||||
compatibilityVersion = "Xcode 8.0";
|
compatibilityVersion = "Xcode 8.0";
|
||||||
developmentRegion = en;
|
developmentRegion = en;
|
||||||
hasScannedForEncodings = 0;
|
hasScannedForEncodings = 0;
|
||||||
@@ -141,13 +145,11 @@
|
|||||||
Base,
|
Base,
|
||||||
);
|
);
|
||||||
mainGroup = 504EC2FB1FED79650016851F;
|
mainGroup = 504EC2FB1FED79650016851F;
|
||||||
packageReferences = (
|
|
||||||
);
|
|
||||||
productRefGroup = 504EC3051FED79650016851F /* Products */;
|
productRefGroup = 504EC3051FED79650016851F /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
targets = (
|
targets = (
|
||||||
504EC3031FED79650016851F /* Time Safari */,
|
504EC3031FED79650016851F /* App */,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
/* End PBXProject section */
|
/* End PBXProject section */
|
||||||
@@ -348,14 +350,12 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 12;
|
||||||
DEVELOPMENT_TEAM = GM3FS5JQPH;
|
DEVELOPMENT_TEAM = GM3FS5JQPH;
|
||||||
INFOPLIST_FILE = App/Info.plist;
|
INFOPLIST_FILE = App/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = "Time Safari";
|
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 0.4.4;
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = app.timesafari;
|
PRODUCT_BUNDLE_IDENTIFIER = app.timesafari;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
@@ -371,14 +371,12 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 12;
|
||||||
DEVELOPMENT_TEAM = GM3FS5JQPH;
|
DEVELOPMENT_TEAM = GM3FS5JQPH;
|
||||||
INFOPLIST_FILE = App/Info.plist;
|
INFOPLIST_FILE = App/Info.plist;
|
||||||
INFOPLIST_KEY_CFBundleDisplayName = "Time Safari";
|
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.social-networking";
|
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
MARKETING_VERSION = 1.0;
|
MARKETING_VERSION = 0.4.4;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = app.timesafari;
|
PRODUCT_BUNDLE_IDENTIFIER = app.timesafari;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
|
||||||
@@ -390,7 +388,7 @@
|
|||||||
/* End XCBuildConfiguration section */
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
/* Begin XCConfigurationList section */
|
/* Begin XCConfigurationList section */
|
||||||
504EC2FF1FED79650016851F /* Build configuration list for PBXProject "Time Safari" */ = {
|
504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
504EC3141FED79650016851F /* Debug */,
|
504EC3141FED79650016851F /* Debug */,
|
||||||
@@ -399,7 +397,7 @@
|
|||||||
defaultConfigurationIsVisible = 0;
|
defaultConfigurationIsVisible = 0;
|
||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "Time Safari" */ = {
|
504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = {
|
||||||
isa = XCConfigurationList;
|
isa = XCConfigurationList;
|
||||||
buildConfigurations = (
|
buildConfigurations = (
|
||||||
504EC3171FED79650016851F /* Debug */,
|
504EC3171FED79650016851F /* Debug */,
|
||||||
2
ios/App/App.xcworkspace/contents.xcworkspacedata
generated
@@ -2,7 +2,7 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Time Safari.xcodeproj">
|
location = "group:App.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "group:Pods/Pods.xcodeproj">
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>IDEDidComputeMac32BitWarning</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -22,6 +22,10 @@
|
|||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSCameraUsageDescription</key>
|
||||||
|
<string>Upload photos and scan friends' QR codes</string>
|
||||||
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
<string>Upload photos for gifts</string>
|
||||||
<key>UILaunchStoryboardName</key>
|
<key>UILaunchStoryboardName</key>
|
||||||
<string>LaunchScreen</string>
|
<string>LaunchScreen</string>
|
||||||
<key>UIMainStoryboardFile</key>
|
<key>UIMainStoryboardFile</key>
|
||||||
@@ -45,5 +49,16 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>app.timesafari</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>timesafari</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array></dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ def capacitor_pods
|
|||||||
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
|
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
|
||||||
|
pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera'
|
||||||
|
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
|
||||||
|
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
|
||||||
|
pod 'CapawesomeCapacitorFilePicker', :path => '../../node_modules/@capawesome/capacitor-file-picker'
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'App' do
|
target 'App' do
|
||||||
|
|||||||
@@ -1,28 +1,52 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- Capacitor (6.2.0):
|
- Capacitor (6.2.1):
|
||||||
- CapacitorCordova
|
- CapacitorCordova
|
||||||
- CapacitorApp (6.0.2):
|
- CapacitorApp (6.0.2):
|
||||||
- Capacitor
|
- Capacitor
|
||||||
- CapacitorCordova (6.2.0)
|
- CapacitorCamera (6.1.2):
|
||||||
|
- Capacitor
|
||||||
|
- CapacitorCordova (6.2.1)
|
||||||
|
- CapacitorFilesystem (6.0.3):
|
||||||
|
- Capacitor
|
||||||
|
- CapacitorShare (6.0.3):
|
||||||
|
- Capacitor
|
||||||
|
- CapawesomeCapacitorFilePicker (6.2.0):
|
||||||
|
- Capacitor
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
|
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
|
||||||
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
|
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
|
||||||
|
- "CapacitorCamera (from `../../node_modules/@capacitor/camera`)"
|
||||||
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
|
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
|
||||||
|
- "CapacitorFilesystem (from `../../node_modules/@capacitor/filesystem`)"
|
||||||
|
- "CapacitorShare (from `../../node_modules/@capacitor/share`)"
|
||||||
|
- "CapawesomeCapacitorFilePicker (from `../../node_modules/@capawesome/capacitor-file-picker`)"
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
Capacitor:
|
Capacitor:
|
||||||
:path: "../../node_modules/@capacitor/ios"
|
:path: "../../node_modules/@capacitor/ios"
|
||||||
CapacitorApp:
|
CapacitorApp:
|
||||||
:path: "../../node_modules/@capacitor/app"
|
:path: "../../node_modules/@capacitor/app"
|
||||||
|
CapacitorCamera:
|
||||||
|
:path: "../../node_modules/@capacitor/camera"
|
||||||
CapacitorCordova:
|
CapacitorCordova:
|
||||||
:path: "../../node_modules/@capacitor/ios"
|
:path: "../../node_modules/@capacitor/ios"
|
||||||
|
CapacitorFilesystem:
|
||||||
|
:path: "../../node_modules/@capacitor/filesystem"
|
||||||
|
CapacitorShare:
|
||||||
|
:path: "../../node_modules/@capacitor/share"
|
||||||
|
CapawesomeCapacitorFilePicker:
|
||||||
|
:path: "../../node_modules/@capawesome/capacitor-file-picker"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
Capacitor: 05d35014f4425b0740fc8776481f6a369ad071bf
|
Capacitor: c95400d761e376be9da6be5a05f226c0e865cebf
|
||||||
CapacitorApp: e1e6b7d05e444d593ca16fd6d76f2b7c48b5aea7
|
CapacitorApp: e1e6b7d05e444d593ca16fd6d76f2b7c48b5aea7
|
||||||
CapacitorCordova: b33e7f4aa4ed105dd43283acdd940964374a87d9
|
CapacitorCamera: 9bc7b005d0e6f1d5f525b8137045b60cffffce79
|
||||||
|
CapacitorCordova: 8d93e14982f440181be7304aa9559ca631d77fff
|
||||||
|
CapacitorFilesystem: 59270a63c60836248812671aa3b15df673fbaf74
|
||||||
|
CapacitorShare: d2a742baec21c8f3b92b361a2fbd2401cdd8288e
|
||||||
|
CapawesomeCapacitorFilePicker: c40822f0a39f86855321943c7829d52bca7f01bd
|
||||||
|
|
||||||
PODFILE CHECKSUM: 4233f5c5f414604460ff96d372542c311b0fb7a8
|
PODFILE CHECKSUM: 1e9280368fd410520414f5741bf8fdfe7847b965
|
||||||
|
|
||||||
COCOAPODS: 1.16.2
|
COCOAPODS: 1.16.2
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
default_platform(:ios)
|
|
||||||
|
|
||||||
platform :ios do
|
|
||||||
desc "Build and deploy iOS app"
|
|
||||||
lane :beta do
|
|
||||||
build_ios_app(
|
|
||||||
scheme: "App",
|
|
||||||
workspace: "App.xcworkspace",
|
|
||||||
export_method: "app-store"
|
|
||||||
)
|
|
||||||
upload_to_testflight
|
|
||||||
end
|
|
||||||
|
|
||||||
lane :release do
|
|
||||||
build_ios_app(
|
|
||||||
scheme: "App",
|
|
||||||
workspace: "App.xcworkspace",
|
|
||||||
export_method: "app-store"
|
|
||||||
)
|
|
||||||
upload_to_app_store
|
|
||||||
end
|
|
||||||
end
|
|
||||||
878
package-lock.json
generated
@@ -27,6 +27,7 @@
|
|||||||
"build:web": "vite build --config vite.config.web.mts",
|
"build:web": "vite build --config vite.config.web.mts",
|
||||||
"electron:dev": "npm run build && electron dist-electron",
|
"electron:dev": "npm run build && electron dist-electron",
|
||||||
"electron:start": "electron dist-electron",
|
"electron:start": "electron dist-electron",
|
||||||
|
"build:android": "rm -rf dist && npm run build:web && npm run build:capacitor && cd android && ./gradlew clean && ./gradlew assembleDebug && cd .. && npx cap sync android && npx capacitor-assets generate --android && npx cap open android",
|
||||||
"electron:build-linux": "npm run build:electron && electron-builder --linux AppImage",
|
"electron:build-linux": "npm run build:electron && electron-builder --linux AppImage",
|
||||||
"electron:build-linux-deb": "npm run build:electron && electron-builder --linux deb",
|
"electron:build-linux-deb": "npm run build:electron && electron-builder --linux deb",
|
||||||
"electron:build-linux-prod": "NODE_ENV=production npm run build:electron && electron-builder --linux AppImage",
|
"electron:build-linux-prod": "NODE_ENV=production npm run build:electron && electron-builder --linux AppImage",
|
||||||
@@ -49,6 +50,8 @@
|
|||||||
"@capacitor/core": "^6.2.0",
|
"@capacitor/core": "^6.2.0",
|
||||||
"@capacitor/filesystem": "^6.0.0",
|
"@capacitor/filesystem": "^6.0.0",
|
||||||
"@capacitor/ios": "^6.2.0",
|
"@capacitor/ios": "^6.2.0",
|
||||||
|
"@capacitor/share": "^6.0.3",
|
||||||
|
"@capawesome/capacitor-file-picker": "^6.2.0",
|
||||||
"@dicebear/collection": "^5.4.1",
|
"@dicebear/collection": "^5.4.1",
|
||||||
"@dicebear/core": "^5.4.1",
|
"@dicebear/core": "^5.4.1",
|
||||||
"@ethersproject/hdnode": "^5.7.0",
|
"@ethersproject/hdnode": "^5.7.0",
|
||||||
|
|||||||
22
scripts/copy-web-assets.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Clean the public directory
|
||||||
|
rm -rf android/app/src/main/assets/public/*
|
||||||
|
|
||||||
|
# Copy web assets
|
||||||
|
cp -r dist/* android/app/src/main/assets/public/
|
||||||
|
|
||||||
|
# Ensure the directory structure exists
|
||||||
|
mkdir -p android/app/src/main/assets/public/assets
|
||||||
|
|
||||||
|
# Copy the main index file
|
||||||
|
cp dist/index.html android/app/src/main/assets/public/
|
||||||
|
|
||||||
|
# Copy all assets
|
||||||
|
cp -r dist/assets/* android/app/src/main/assets/public/assets/
|
||||||
|
|
||||||
|
# Copy other necessary files
|
||||||
|
cp dist/favicon.ico android/app/src/main/assets/public/
|
||||||
|
cp dist/robots.txt android/app/src/main/assets/public/
|
||||||
|
|
||||||
|
echo "Web assets copied successfully!"
|
||||||
22
scripts/generate-icons.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Create directories if they don't exist
|
||||||
|
mkdir -p android/app/src/main/res/mipmap-mdpi
|
||||||
|
mkdir -p android/app/src/main/res/mipmap-hdpi
|
||||||
|
mkdir -p android/app/src/main/res/mipmap-xhdpi
|
||||||
|
mkdir -p android/app/src/main/res/mipmap-xxhdpi
|
||||||
|
mkdir -p android/app/src/main/res/mipmap-xxxhdpi
|
||||||
|
|
||||||
|
# Generate placeholder icons using ImageMagick
|
||||||
|
convert -size 48x48 xc:blue -gravity center -pointsize 20 -fill white -annotate 0 "TS" android/app/src/main/res/mipmap-mdpi/ic_launcher.png
|
||||||
|
convert -size 72x72 xc:blue -gravity center -pointsize 30 -fill white -annotate 0 "TS" android/app/src/main/res/mipmap-hdpi/ic_launcher.png
|
||||||
|
convert -size 96x96 xc:blue -gravity center -pointsize 40 -fill white -annotate 0 "TS" android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
|
||||||
|
convert -size 144x144 xc:blue -gravity center -pointsize 60 -fill white -annotate 0 "TS" android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
|
||||||
|
convert -size 192x192 xc:blue -gravity center -pointsize 80 -fill white -annotate 0 "TS" android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
|
||||||
|
|
||||||
|
# Copy to round versions
|
||||||
|
cp android/app/src/main/res/mipmap-mdpi/ic_launcher.png android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
|
||||||
|
cp android/app/src/main/res/mipmap-hdpi/ic_launcher.png android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
|
||||||
|
cp android/app/src/main/res/mipmap-xhdpi/ic_launcher.png android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
|
||||||
|
cp android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
|
||||||
|
cp android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
|
||||||
@@ -103,7 +103,7 @@ const cleanIosPlatform = async (log) => {
|
|||||||
// Get app name from package.json
|
// Get app name from package.json
|
||||||
const packageJson = JSON.parse(readFileSync('package.json', 'utf8'));
|
const packageJson = JSON.parse(readFileSync('package.json', 'utf8'));
|
||||||
const appName = packageJson.name || 'App';
|
const appName = packageJson.name || 'App';
|
||||||
const appId = packageJson.capacitor?.appId || 'io.ionic.starter';
|
const appId = packageJson.build.appId || 'io.ionic.starter';
|
||||||
|
|
||||||
// Create a minimal capacitor config
|
// Create a minimal capacitor config
|
||||||
const capacitorConfig = `
|
const capacitorConfig = `
|
||||||
@@ -467,12 +467,12 @@ const configureIosProject = async (log) => {
|
|||||||
// Build and test iOS project
|
// Build and test iOS project
|
||||||
const buildAndTestIos = async (log, simulator) => {
|
const buildAndTestIos = async (log, simulator) => {
|
||||||
const simulatorName = simulator[0].name;
|
const simulatorName = simulator[0].name;
|
||||||
log('🏗️ Building iOS project...');
|
log('🏗️ Building iOS project...', simulator[0]);
|
||||||
execSync('cd ios/App && xcodebuild clean -workspace App.xcworkspace -scheme App', { stdio: 'inherit' });
|
execSync('cd ios/App && xcodebuild clean -workspace App.xcworkspace -scheme App', { stdio: 'inherit' });
|
||||||
log('✅ Xcode clean completed');
|
log('✅ Xcode clean completed');
|
||||||
|
|
||||||
log(`🏗️ Building for simulator: ${simulatorName}`);
|
log(`🏗️ Building for simulator: ${simulatorName}`);
|
||||||
execSync(`cd ios/App && xcodebuild build -workspace App.xcworkspace -scheme App -destination "platform=iOS Simulator,name=${simulatorName}"`, { stdio: 'inherit' });
|
execSync(`cd ios/App && xcodebuild build -workspace App.xcworkspace -scheme App -destination "platform=iOS Simulator,OS=17.2,name=${simulatorName}"`, { stdio: 'inherit' });
|
||||||
log('✅ Xcode build completed');
|
log('✅ Xcode build completed');
|
||||||
|
|
||||||
// Check if the project is configured for testing by querying the scheme capabilities
|
// Check if the project is configured for testing by querying the scheme capabilities
|
||||||
|
|||||||
@@ -1,16 +1,9 @@
|
|||||||
/**
|
/** * Data Export Section Component * * Provides UI and functionality for
|
||||||
* Data Export Section Component
|
exporting user data and backing up identifier seeds. * Includes buttons for seed
|
||||||
*
|
backup and database export, with platform-specific download instructions. * *
|
||||||
* Provides UI and functionality for exporting user data and backing up identifier seeds.
|
@component * @displayName DataExportSection * @example * ```vue *
|
||||||
* Includes buttons for seed backup and database export, with platform-specific download instructions.
|
<DataExportSection :active-did="currentDid" />
|
||||||
*
|
* ``` */
|
||||||
* @component
|
|
||||||
* @displayName DataExportSection
|
|
||||||
* @example
|
|
||||||
* ```vue
|
|
||||||
* <DataExportSection :active-did="currentDid" />
|
|
||||||
* ```
|
|
||||||
*/
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
@@ -42,20 +35,25 @@
|
|||||||
>
|
>
|
||||||
If no download happened yet, click again here to download now.
|
If no download happened yet, click again here to download now.
|
||||||
</a>
|
</a>
|
||||||
<div class="mt-4" v-if="showPlatformInstructions">
|
<div v-if="platformCapabilities.needsFileHandlingInstructions" class="mt-4">
|
||||||
<p>
|
<p>
|
||||||
After the download, you can save the file in your preferred storage
|
After the download, you can save the file in your preferred storage
|
||||||
location.
|
location.
|
||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-if="platformService.isCapacitor() && isIOS" class="list-disc list-outside ml-4">
|
<li
|
||||||
On iOS: Choose "More..." and select a place in iCloud, or go "Back"
|
v-if="platformCapabilities.isIOS"
|
||||||
and save to another location.
|
class="list-disc list-outside ml-4"
|
||||||
|
>
|
||||||
|
On iOS: You will be prompted to choose a location to save your backup
|
||||||
|
file.
|
||||||
</li>
|
</li>
|
||||||
<li v-if="platformService.isCapacitor() && !isIOS" class="list-disc list-outside ml-4">
|
<li
|
||||||
On Android: Choose "Open" and then share
|
v-if="platformCapabilities.isMobile && !platformCapabilities.isIOS"
|
||||||
<font-awesome icon="share-nodes" class="fa-fw" />
|
class="list-disc list-outside ml-4"
|
||||||
to your prefered place.
|
>
|
||||||
|
On Android: You will be prompted to choose a location to save your
|
||||||
|
backup file.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -68,7 +66,10 @@ import { NotificationIface } from "../constants/app";
|
|||||||
import { db } from "../db/index";
|
import { db } from "../db/index";
|
||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
import { PlatformServiceFactory } from "../services/PlatformServiceFactory";
|
import { PlatformServiceFactory } from "../services/PlatformServiceFactory";
|
||||||
import { PlatformService } from "../services/PlatformService";
|
import {
|
||||||
|
PlatformService,
|
||||||
|
PlatformCapabilities,
|
||||||
|
} from "../services/PlatformService";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @vue-component
|
* @vue-component
|
||||||
@@ -100,20 +101,14 @@ export default class DataExportSection extends Vue {
|
|||||||
/**
|
/**
|
||||||
* Platform service instance for platform-specific operations
|
* Platform service instance for platform-specific operations
|
||||||
*/
|
*/
|
||||||
private platformService: PlatformService = PlatformServiceFactory.getInstance();
|
private platformService: PlatformService =
|
||||||
|
PlatformServiceFactory.getInstance();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the current platform is iOS
|
* Platform capabilities for the current platform
|
||||||
*/
|
*/
|
||||||
private get isIOS(): boolean {
|
private get platformCapabilities(): PlatformCapabilities {
|
||||||
return /iPad|iPhone|iPod/.test(navigator.userAgent);
|
return this.platformService.getCapabilities();
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to show platform-specific instructions
|
|
||||||
*/
|
|
||||||
private get showPlatformInstructions(): boolean {
|
|
||||||
return this.platformService.isCapacitor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -121,7 +116,7 @@ export default class DataExportSection extends Vue {
|
|||||||
* Revokes object URL when component is unmounted (web platform only)
|
* Revokes object URL when component is unmounted (web platform only)
|
||||||
*/
|
*/
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
if (this.downloadUrl && this.platformService.isWeb()) {
|
if (this.downloadUrl && this.platformCapabilities.hasFileDownload) {
|
||||||
URL.revokeObjectURL(this.downloadUrl);
|
URL.revokeObjectURL(this.downloadUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -139,7 +134,7 @@ export default class DataExportSection extends Vue {
|
|||||||
const blob = await db.export({ prettyJson: true });
|
const blob = await db.export({ prettyJson: true });
|
||||||
const fileName = `${db.name}-backup.json`;
|
const fileName = `${db.name}-backup.json`;
|
||||||
|
|
||||||
if (this.platformService.isWeb()) {
|
if (this.platformCapabilities.hasFileDownload) {
|
||||||
// Web platform: Use download link
|
// Web platform: Use download link
|
||||||
this.downloadUrl = URL.createObjectURL(blob);
|
this.downloadUrl = URL.createObjectURL(blob);
|
||||||
const downloadAnchor = this.$refs.downloadLink as HTMLAnchorElement;
|
const downloadAnchor = this.$refs.downloadLink as HTMLAnchorElement;
|
||||||
@@ -147,13 +142,10 @@ export default class DataExportSection extends Vue {
|
|||||||
downloadAnchor.download = fileName;
|
downloadAnchor.download = fileName;
|
||||||
downloadAnchor.click();
|
downloadAnchor.click();
|
||||||
setTimeout(() => URL.revokeObjectURL(this.downloadUrl), 1000);
|
setTimeout(() => URL.revokeObjectURL(this.downloadUrl), 1000);
|
||||||
} else if (this.platformService.isCapacitor()) {
|
} else if (this.platformCapabilities.hasFileSystem) {
|
||||||
// Capacitor platform: Write to app directory
|
// Native platform: Write to app directory
|
||||||
const content = await blob.text();
|
const content = await blob.text();
|
||||||
await this.platformService.writeFile(fileName, content);
|
await this.platformService.writeAndShareFile(fileName, content);
|
||||||
} else {
|
|
||||||
// Other platforms: Use platform service
|
|
||||||
await this.platformService.writeFile(fileName, await blob.text());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$notify(
|
this.$notify(
|
||||||
@@ -161,9 +153,9 @@ export default class DataExportSection extends Vue {
|
|||||||
group: "alert",
|
group: "alert",
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Export Successful",
|
title: "Export Successful",
|
||||||
text: this.platformService.isWeb()
|
text: this.platformCapabilities.hasFileDownload
|
||||||
? "See your downloads directory for the backup. It is in the Dexie format."
|
? "See your downloads directory for the backup. It is in the Dexie format."
|
||||||
: "The backup has been saved to your device.",
|
: "Please choose a location to save your backup file.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
@@ -187,7 +179,7 @@ export default class DataExportSection extends Vue {
|
|||||||
*/
|
*/
|
||||||
public computedStartDownloadLinkClassNames() {
|
public computedStartDownloadLinkClassNames() {
|
||||||
return {
|
return {
|
||||||
hidden: this.downloadUrl && this.platformService.isWeb(),
|
hidden: this.downloadUrl && this.platformCapabilities.hasFileDownload,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +189,7 @@ export default class DataExportSection extends Vue {
|
|||||||
*/
|
*/
|
||||||
public computedDownloadLinkClassNames() {
|
public computedDownloadLinkClassNames() {
|
||||||
return {
|
return {
|
||||||
hidden: !this.downloadUrl || !this.platformService.isWeb(),
|
hidden: !this.downloadUrl || !this.platformCapabilities.hasFileDownload,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,38 @@ export interface ImageResult {
|
|||||||
fileName: string;
|
fileName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Platform capabilities interface defining what features are available
|
||||||
|
* on the current platform implementation
|
||||||
|
*/
|
||||||
|
export interface PlatformCapabilities {
|
||||||
|
/** Whether the platform supports native file system access */
|
||||||
|
hasFileSystem: boolean;
|
||||||
|
/** Whether the platform supports native camera access */
|
||||||
|
hasCamera: boolean;
|
||||||
|
/** Whether the platform is a mobile device */
|
||||||
|
isMobile: boolean;
|
||||||
|
/** Whether the platform is iOS specifically */
|
||||||
|
isIOS: boolean;
|
||||||
|
/** Whether the platform supports native file download */
|
||||||
|
hasFileDownload: boolean;
|
||||||
|
/** Whether the platform requires special file handling instructions */
|
||||||
|
needsFileHandlingInstructions: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Platform-agnostic interface for handling platform-specific operations.
|
* Platform-agnostic interface for handling platform-specific operations.
|
||||||
* Provides a common API for file system operations, camera interactions,
|
* Provides a common API for file system operations, camera interactions,
|
||||||
* platform detection, and deep linking across different platforms
|
* and platform detection across different platforms (web, mobile, desktop).
|
||||||
* (web, mobile, desktop).
|
|
||||||
*/
|
*/
|
||||||
export interface PlatformService {
|
export interface PlatformService {
|
||||||
|
// Platform capabilities
|
||||||
|
/**
|
||||||
|
* Gets the current platform's capabilities
|
||||||
|
* @returns Object describing what features are available on this platform
|
||||||
|
*/
|
||||||
|
getCapabilities(): PlatformCapabilities;
|
||||||
|
|
||||||
// File system operations
|
// File system operations
|
||||||
/**
|
/**
|
||||||
* Reads the contents of a file at the specified path.
|
* Reads the contents of a file at the specified path.
|
||||||
@@ -32,6 +57,14 @@ export interface PlatformService {
|
|||||||
*/
|
*/
|
||||||
writeFile(path: string, content: string): Promise<void>;
|
writeFile(path: string, content: string): Promise<void>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes content to a file at the specified path and shares it.
|
||||||
|
* @param fileName - The filename of the file to write
|
||||||
|
* @param content - The content to write to the file
|
||||||
|
* @returns Promise that resolves when the write is complete
|
||||||
|
*/
|
||||||
|
writeAndShareFile(fileName: string, content: string): Promise<void>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a file at the specified path.
|
* Deletes a file at the specified path.
|
||||||
* @param path - The path to the file to delete
|
* @param path - The path to the file to delete
|
||||||
@@ -59,32 +92,6 @@ export interface PlatformService {
|
|||||||
*/
|
*/
|
||||||
pickImage(): Promise<ImageResult>;
|
pickImage(): Promise<ImageResult>;
|
||||||
|
|
||||||
// Platform specific features
|
|
||||||
/**
|
|
||||||
* Checks if the current platform is Capacitor (mobile).
|
|
||||||
* @returns true if running on Capacitor
|
|
||||||
*/
|
|
||||||
isCapacitor(): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the current platform is Electron (desktop).
|
|
||||||
* @returns true if running on Electron
|
|
||||||
*/
|
|
||||||
isElectron(): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the current platform is PyWebView.
|
|
||||||
* @returns true if running on PyWebView
|
|
||||||
*/
|
|
||||||
isPyWebView(): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the current platform is web browser.
|
|
||||||
* @returns true if running in a web browser
|
|
||||||
*/
|
|
||||||
isWeb(): boolean;
|
|
||||||
|
|
||||||
// Deep linking
|
|
||||||
/**
|
/**
|
||||||
* Handles deep link URLs for the application.
|
* Handles deep link URLs for the application.
|
||||||
* @param url - The deep link URL to handle
|
* @param url - The deep link URL to handle
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import { ImageResult, PlatformService } from "../PlatformService";
|
import {
|
||||||
import { Filesystem, Directory } from "@capacitor/filesystem";
|
ImageResult,
|
||||||
|
PlatformService,
|
||||||
|
PlatformCapabilities,
|
||||||
|
} from "../PlatformService";
|
||||||
|
import { Filesystem, Directory, Encoding } from "@capacitor/filesystem";
|
||||||
import { Camera, CameraResultType, CameraSource } from "@capacitor/camera";
|
import { Camera, CameraResultType, CameraSource } from "@capacitor/camera";
|
||||||
|
import { Share } from "@capacitor/share";
|
||||||
import { logger } from "../../utils/logger";
|
import { logger } from "../../utils/logger";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,6 +16,128 @@ import { logger } from "../../utils/logger";
|
|||||||
* - Platform-specific features
|
* - Platform-specific features
|
||||||
*/
|
*/
|
||||||
export class CapacitorPlatformService implements PlatformService {
|
export class CapacitorPlatformService implements PlatformService {
|
||||||
|
/**
|
||||||
|
* Gets the capabilities of the Capacitor platform
|
||||||
|
* @returns Platform capabilities object
|
||||||
|
*/
|
||||||
|
getCapabilities(): PlatformCapabilities {
|
||||||
|
return {
|
||||||
|
hasFileSystem: true,
|
||||||
|
hasCamera: true,
|
||||||
|
isMobile: true,
|
||||||
|
isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent),
|
||||||
|
hasFileDownload: false,
|
||||||
|
needsFileHandlingInstructions: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks and requests storage permissions if needed
|
||||||
|
* @returns Promise that resolves when permissions are granted
|
||||||
|
* @throws Error if permissions are denied
|
||||||
|
*/
|
||||||
|
private async checkStoragePermissions(): Promise<void> {
|
||||||
|
try {
|
||||||
|
const logData = {
|
||||||
|
platform: this.getCapabilities().isIOS ? "iOS" : "Android",
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.log(
|
||||||
|
"Checking storage permissions",
|
||||||
|
JSON.stringify(logData, null, 2),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (this.getCapabilities().isIOS) {
|
||||||
|
// iOS uses different permission model
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to access a test directory to check permissions
|
||||||
|
try {
|
||||||
|
await Filesystem.stat({
|
||||||
|
path: "/storage/emulated/0/Download",
|
||||||
|
directory: Directory.Documents,
|
||||||
|
});
|
||||||
|
logger.log(
|
||||||
|
"Storage permissions already granted",
|
||||||
|
JSON.stringify({ timestamp: new Date().toISOString() }, null, 2),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
} catch (error: unknown) {
|
||||||
|
const err = error as Error;
|
||||||
|
const errorLogData = {
|
||||||
|
error: {
|
||||||
|
message: err.message,
|
||||||
|
name: err.name,
|
||||||
|
stack: err.stack,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
|
||||||
|
// "File does not exist" is expected and not a permission error
|
||||||
|
if (err.message === "File does not exist") {
|
||||||
|
logger.log(
|
||||||
|
"Directory does not exist (expected), proceeding with write",
|
||||||
|
JSON.stringify(errorLogData, null, 2),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for actual permission errors
|
||||||
|
if (
|
||||||
|
err.message.includes("permission") ||
|
||||||
|
err.message.includes("access")
|
||||||
|
) {
|
||||||
|
logger.log(
|
||||||
|
"Permission check failed, requesting permissions",
|
||||||
|
JSON.stringify(errorLogData, null, 2),
|
||||||
|
);
|
||||||
|
|
||||||
|
// The Filesystem plugin will automatically request permissions when needed
|
||||||
|
// We just need to try the operation again
|
||||||
|
try {
|
||||||
|
await Filesystem.stat({
|
||||||
|
path: "/storage/emulated/0/Download",
|
||||||
|
directory: Directory.Documents,
|
||||||
|
});
|
||||||
|
logger.log(
|
||||||
|
"Storage permissions granted after request",
|
||||||
|
JSON.stringify({ timestamp: new Date().toISOString() }, null, 2),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
} catch (retryError: unknown) {
|
||||||
|
const retryErr = retryError as Error;
|
||||||
|
throw new Error(
|
||||||
|
`Failed to obtain storage permissions: ${retryErr.message}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For any other error, log it but don't treat as permission error
|
||||||
|
logger.log(
|
||||||
|
"Unexpected error during permission check",
|
||||||
|
JSON.stringify(errorLogData, null, 2),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
const err = error as Error;
|
||||||
|
const errorLogData = {
|
||||||
|
error: {
|
||||||
|
message: err.message,
|
||||||
|
name: err.name,
|
||||||
|
stack: err.stack,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.error(
|
||||||
|
"Error checking/requesting permissions",
|
||||||
|
JSON.stringify(errorLogData, null, 2),
|
||||||
|
);
|
||||||
|
throw new Error(`Failed to obtain storage permissions: ${err.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a file from the app's data directory.
|
* Reads a file from the app's data directory.
|
||||||
* @param path - Relative path to the file in the app's data directory
|
* @param path - Relative path to the file in the app's data directory
|
||||||
@@ -29,17 +156,202 @@ export class CapacitorPlatformService implements PlatformService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes content to a file in the app's data directory.
|
* Writes content to a file in the app's safe storage and offers sharing.
|
||||||
* @param path - Relative path where to write the file
|
*
|
||||||
* @param content - Content to write to the file
|
* Platform-specific behavior:
|
||||||
* @throws Error if write operation fails
|
* - Saves to app's Documents directory
|
||||||
|
* - Offers sharing functionality to move file elsewhere
|
||||||
|
*
|
||||||
|
* The method handles:
|
||||||
|
* 1. Writing to app-safe storage
|
||||||
|
* 2. Sharing the file with user's preferred app
|
||||||
|
* 3. Error handling and logging
|
||||||
|
*
|
||||||
|
* @param fileName - The name of the file to create (e.g. "backup.json")
|
||||||
|
* @param content - The content to write to the file
|
||||||
|
*
|
||||||
|
* @throws Error if:
|
||||||
|
* - File writing fails
|
||||||
|
* - Sharing fails
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```typescript
|
||||||
|
* // Save and share a JSON file
|
||||||
|
* await platformService.writeFile(
|
||||||
|
* "backup.json",
|
||||||
|
* JSON.stringify(data)
|
||||||
|
* );
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
async writeFile(path: string, content: string): Promise<void> {
|
async writeFile(fileName: string, content: string): Promise<void> {
|
||||||
await Filesystem.writeFile({
|
try {
|
||||||
path,
|
const logData = {
|
||||||
data: content,
|
targetFileName: fileName,
|
||||||
directory: Directory.Data,
|
contentLength: content.length,
|
||||||
});
|
platform: this.getCapabilities().isIOS ? "iOS" : "Android",
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.log(
|
||||||
|
"Starting writeFile operation",
|
||||||
|
JSON.stringify(logData, null, 2),
|
||||||
|
);
|
||||||
|
|
||||||
|
// For Android, we need to handle content URIs differently
|
||||||
|
if (this.getCapabilities().isIOS) {
|
||||||
|
// Write to app's Documents directory for iOS
|
||||||
|
const writeResult = await Filesystem.writeFile({
|
||||||
|
path: fileName,
|
||||||
|
data: content,
|
||||||
|
directory: Directory.Data,
|
||||||
|
encoding: Encoding.UTF8,
|
||||||
|
});
|
||||||
|
|
||||||
|
const writeSuccessLogData = {
|
||||||
|
path: writeResult.uri,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.log(
|
||||||
|
"File write successful",
|
||||||
|
JSON.stringify(writeSuccessLogData, null, 2),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Offer to share the file
|
||||||
|
try {
|
||||||
|
await Share.share({
|
||||||
|
title: "TimeSafari Backup",
|
||||||
|
text: "Here is your TimeSafari backup file.",
|
||||||
|
url: writeResult.uri,
|
||||||
|
dialogTitle: "Share your backup",
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.log(
|
||||||
|
"Share dialog shown",
|
||||||
|
JSON.stringify({ timestamp: new Date().toISOString() }, null, 2),
|
||||||
|
);
|
||||||
|
} catch (shareError) {
|
||||||
|
// Log share error but don't fail the operation
|
||||||
|
logger.error(
|
||||||
|
"Share dialog failed",
|
||||||
|
JSON.stringify(
|
||||||
|
{
|
||||||
|
error: shareError,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
2,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// For Android, first write to app's Documents directory
|
||||||
|
const writeResult = await Filesystem.writeFile({
|
||||||
|
path: fileName,
|
||||||
|
data: content,
|
||||||
|
directory: Directory.Data,
|
||||||
|
encoding: Encoding.UTF8,
|
||||||
|
});
|
||||||
|
|
||||||
|
const writeSuccessLogData = {
|
||||||
|
path: writeResult.uri,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.log(
|
||||||
|
"File write successful to app storage",
|
||||||
|
JSON.stringify(writeSuccessLogData, null, 2),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Then share the file to let user choose where to save it
|
||||||
|
try {
|
||||||
|
await Share.share({
|
||||||
|
title: "TimeSafari Backup",
|
||||||
|
text: "Here is your TimeSafari backup file.",
|
||||||
|
url: writeResult.uri,
|
||||||
|
dialogTitle: "Save your backup",
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.log(
|
||||||
|
"Share dialog shown for Android",
|
||||||
|
JSON.stringify({ timestamp: new Date().toISOString() }, null, 2),
|
||||||
|
);
|
||||||
|
} catch (shareError) {
|
||||||
|
// Log share error but don't fail the operation
|
||||||
|
logger.error(
|
||||||
|
"Share dialog failed for Android",
|
||||||
|
JSON.stringify(
|
||||||
|
{
|
||||||
|
error: shareError,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
},
|
||||||
|
null,
|
||||||
|
2,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error: unknown) {
|
||||||
|
const err = error as Error;
|
||||||
|
const finalErrorLogData = {
|
||||||
|
error: {
|
||||||
|
message: err.message,
|
||||||
|
name: err.name,
|
||||||
|
stack: err.stack,
|
||||||
|
},
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.error(
|
||||||
|
"Error in writeFile operation:",
|
||||||
|
JSON.stringify(finalErrorLogData, null, 2),
|
||||||
|
);
|
||||||
|
throw new Error(`Failed to save file: ${err.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes content to a file in the device's app-private storage.
|
||||||
|
* Then shares the file using the system share dialog.
|
||||||
|
*
|
||||||
|
* Works on both Android and iOS without needing external storage permissions.
|
||||||
|
*
|
||||||
|
* @param fileName - The name of the file to create (e.g. "backup.json")
|
||||||
|
* @param content - The content to write to the file
|
||||||
|
*/
|
||||||
|
async writeAndShareFile(fileName: string, content: string): Promise<void> {
|
||||||
|
const timestamp = new Date().toISOString();
|
||||||
|
const logData = {
|
||||||
|
action: 'writeAndShareFile',
|
||||||
|
fileName,
|
||||||
|
contentLength: content.length,
|
||||||
|
timestamp,
|
||||||
|
};
|
||||||
|
logger.log('[CapacitorPlatformService]', JSON.stringify(logData, null, 2));
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { uri } = await Filesystem.writeFile({
|
||||||
|
path: fileName,
|
||||||
|
data: content,
|
||||||
|
directory: Directory.Data,
|
||||||
|
encoding: Encoding.UTF8,
|
||||||
|
recursive: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.log('[CapacitorPlatformService] File write successful:', { uri, timestamp: new Date().toISOString() });
|
||||||
|
|
||||||
|
await Share.share({
|
||||||
|
title: 'TimeSafari Backup',
|
||||||
|
text: 'Here is your backup file.',
|
||||||
|
url: uri,
|
||||||
|
dialogTitle: 'Share your backup file',
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
const err = error as Error;
|
||||||
|
const errLog = {
|
||||||
|
message: err.message,
|
||||||
|
stack: err.stack,
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
logger.error('[CapacitorPlatformService] Error writing or sharing file:', JSON.stringify(errLog, null, 2));
|
||||||
|
throw new Error(`Failed to write or share file: ${err.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,7 +377,9 @@ export class CapacitorPlatformService implements PlatformService {
|
|||||||
path: directory,
|
path: directory,
|
||||||
directory: Directory.Data,
|
directory: Directory.Data,
|
||||||
});
|
});
|
||||||
return result.files.map(file => typeof file === 'string' ? file : file.name);
|
return result.files.map((file) =>
|
||||||
|
typeof file === "string" ? file : file.name,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -146,38 +460,6 @@ export class CapacitorPlatformService implements PlatformService {
|
|||||||
return new Blob(byteArrays, { type: "image/jpeg" });
|
return new Blob(byteArrays, { type: "image/jpeg" });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on Capacitor platform.
|
|
||||||
* @returns true, as this is the Capacitor implementation
|
|
||||||
*/
|
|
||||||
isCapacitor(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on Electron platform.
|
|
||||||
* @returns false, as this is not Electron
|
|
||||||
*/
|
|
||||||
isElectron(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on PyWebView platform.
|
|
||||||
* @returns false, as this is not PyWebView
|
|
||||||
*/
|
|
||||||
isPyWebView(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on web platform.
|
|
||||||
* @returns false, as this is not web
|
|
||||||
*/
|
|
||||||
isWeb(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles deep link URLs for the application.
|
* Handles deep link URLs for the application.
|
||||||
* Note: Capacitor handles deep links automatically.
|
* Note: Capacitor handles deep links automatically.
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { ImageResult, PlatformService } from "../PlatformService";
|
import {
|
||||||
|
ImageResult,
|
||||||
|
PlatformService,
|
||||||
|
PlatformCapabilities,
|
||||||
|
} from "../PlatformService";
|
||||||
import { logger } from "../../utils/logger";
|
import { logger } from "../../utils/logger";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -14,6 +18,21 @@ import { logger } from "../../utils/logger";
|
|||||||
* - System-level features
|
* - System-level features
|
||||||
*/
|
*/
|
||||||
export class ElectronPlatformService implements PlatformService {
|
export class ElectronPlatformService implements PlatformService {
|
||||||
|
/**
|
||||||
|
* Gets the capabilities of the Electron platform
|
||||||
|
* @returns Platform capabilities object
|
||||||
|
*/
|
||||||
|
getCapabilities(): PlatformCapabilities {
|
||||||
|
return {
|
||||||
|
hasFileSystem: false, // Not implemented yet
|
||||||
|
hasCamera: false, // Not implemented yet
|
||||||
|
isMobile: false,
|
||||||
|
isIOS: false,
|
||||||
|
hasFileDownload: false, // Not implemented yet
|
||||||
|
needsFileHandlingInstructions: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a file from the filesystem.
|
* Reads a file from the filesystem.
|
||||||
* @param _path - Path to the file to read
|
* @param _path - Path to the file to read
|
||||||
@@ -79,38 +98,6 @@ export class ElectronPlatformService implements PlatformService {
|
|||||||
throw new Error("Not implemented");
|
throw new Error("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on Capacitor platform.
|
|
||||||
* @returns false, as this is not Capacitor
|
|
||||||
*/
|
|
||||||
isCapacitor(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on Electron platform.
|
|
||||||
* @returns true, as this is the Electron implementation
|
|
||||||
*/
|
|
||||||
isElectron(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on PyWebView platform.
|
|
||||||
* @returns false, as this is not PyWebView
|
|
||||||
*/
|
|
||||||
isPyWebView(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on web platform.
|
|
||||||
* @returns false, as this is not web
|
|
||||||
*/
|
|
||||||
isWeb(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should handle deep link URLs for the desktop application.
|
* Should handle deep link URLs for the desktop application.
|
||||||
* @param _url - The deep link URL to handle
|
* @param _url - The deep link URL to handle
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { ImageResult, PlatformService } from "../PlatformService";
|
import {
|
||||||
|
ImageResult,
|
||||||
|
PlatformService,
|
||||||
|
PlatformCapabilities,
|
||||||
|
} from "../PlatformService";
|
||||||
import { logger } from "../../utils/logger";
|
import { logger } from "../../utils/logger";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,6 +19,21 @@ import { logger } from "../../utils/logger";
|
|||||||
* - Python-JavaScript bridge functionality
|
* - Python-JavaScript bridge functionality
|
||||||
*/
|
*/
|
||||||
export class PyWebViewPlatformService implements PlatformService {
|
export class PyWebViewPlatformService implements PlatformService {
|
||||||
|
/**
|
||||||
|
* Gets the capabilities of the PyWebView platform
|
||||||
|
* @returns Platform capabilities object
|
||||||
|
*/
|
||||||
|
getCapabilities(): PlatformCapabilities {
|
||||||
|
return {
|
||||||
|
hasFileSystem: false, // Not implemented yet
|
||||||
|
hasCamera: false, // Not implemented yet
|
||||||
|
isMobile: false,
|
||||||
|
isIOS: false,
|
||||||
|
hasFileDownload: false, // Not implemented yet
|
||||||
|
needsFileHandlingInstructions: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a file using the Python backend.
|
* Reads a file using the Python backend.
|
||||||
* @param _path - Path to the file to read
|
* @param _path - Path to the file to read
|
||||||
@@ -80,38 +99,6 @@ export class PyWebViewPlatformService implements PlatformService {
|
|||||||
throw new Error("Not implemented");
|
throw new Error("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on Capacitor platform.
|
|
||||||
* @returns false, as this is not Capacitor
|
|
||||||
*/
|
|
||||||
isCapacitor(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on Electron platform.
|
|
||||||
* @returns false, as this is not Electron
|
|
||||||
*/
|
|
||||||
isElectron(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on PyWebView platform.
|
|
||||||
* @returns true, as this is the PyWebView implementation
|
|
||||||
*/
|
|
||||||
isPyWebView(): boolean {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if running on web platform.
|
|
||||||
* @returns false, as this is not web
|
|
||||||
*/
|
|
||||||
isWeb(): boolean {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should handle deep link URLs through the Python backend.
|
* Should handle deep link URLs through the Python backend.
|
||||||
* @param _url - The deep link URL to handle
|
* @param _url - The deep link URL to handle
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { ImageResult, PlatformService } from "../PlatformService";
|
import {
|
||||||
|
ImageResult,
|
||||||
|
PlatformService,
|
||||||
|
PlatformCapabilities,
|
||||||
|
} from "../PlatformService";
|
||||||
import { logger } from "../../utils/logger";
|
import { logger } from "../../utils/logger";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,6 +19,21 @@ import { logger } from "../../utils/logger";
|
|||||||
* due to browser security restrictions. These methods throw appropriate errors.
|
* due to browser security restrictions. These methods throw appropriate errors.
|
||||||
*/
|
*/
|
||||||
export class WebPlatformService implements PlatformService {
|
export class WebPlatformService implements PlatformService {
|
||||||
|
/**
|
||||||
|
* Gets the capabilities of the web platform
|
||||||
|
* @returns Platform capabilities object
|
||||||
|
*/
|
||||||
|
getCapabilities(): PlatformCapabilities {
|
||||||
|
return {
|
||||||
|
hasFileSystem: false,
|
||||||
|
hasCamera: true, // Through file input with capture
|
||||||
|
isMobile: /iPhone|iPad|iPod|Android/i.test(navigator.userAgent),
|
||||||
|
isIOS: /iPad|iPhone|iPod/.test(navigator.userAgent),
|
||||||
|
hasFileDownload: true,
|
||||||
|
needsFileHandlingInstructions: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not supported in web platform.
|
* Not supported in web platform.
|
||||||
* @param _path - Unused path parameter
|
* @param _path - Unused path parameter
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ function safeStringify(obj: unknown) {
|
|||||||
|
|
||||||
export const logger = {
|
export const logger = {
|
||||||
log: (message: string, ...args: unknown[]) => {
|
log: (message: string, ...args: unknown[]) => {
|
||||||
if (process.env.NODE_ENV !== "production") {
|
if (
|
||||||
|
process.env.NODE_ENV !== "production" ||
|
||||||
|
process.env.VITE_PLATFORM === "capacitor"
|
||||||
|
) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log(message, ...args);
|
console.log(message, ...args);
|
||||||
const argsString = args.length > 0 ? " - " + safeStringify(args) : "";
|
const argsString = args.length > 0 ? " - " + safeStringify(args) : "";
|
||||||
@@ -29,7 +32,10 @@ export const logger = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
warn: (message: string, ...args: unknown[]) => {
|
warn: (message: string, ...args: unknown[]) => {
|
||||||
if (process.env.NODE_ENV !== "production") {
|
if (
|
||||||
|
process.env.NODE_ENV !== "production" ||
|
||||||
|
process.env.VITE_PLATFORM === "capacitor"
|
||||||
|
) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.warn(message, ...args);
|
console.warn(message, ...args);
|
||||||
const argsString = args.length > 0 ? " - " + safeStringify(args) : "";
|
const argsString = args.length > 0 ? " - " + safeStringify(args) : "";
|
||||||
|
|||||||
@@ -350,6 +350,47 @@ import * as serverUtil from "../libs/endorserServer";
|
|||||||
import { logger } from "../utils/logger";
|
import { logger } from "../utils/logger";
|
||||||
import { GiveRecordWithContactInfo } from "types";
|
import { GiveRecordWithContactInfo } from "types";
|
||||||
|
|
||||||
|
interface Claim {
|
||||||
|
claim?: Claim; // For nested claims in Verifiable Credentials
|
||||||
|
agent?: {
|
||||||
|
identifier?: string;
|
||||||
|
did?: string;
|
||||||
|
};
|
||||||
|
recipient?: {
|
||||||
|
identifier?: string;
|
||||||
|
did?: string;
|
||||||
|
};
|
||||||
|
provider?:
|
||||||
|
| {
|
||||||
|
identifier?: string;
|
||||||
|
}
|
||||||
|
| Array<{ identifier?: string }>;
|
||||||
|
object?: {
|
||||||
|
amountOfThisGood?: number;
|
||||||
|
unitCode?: string;
|
||||||
|
};
|
||||||
|
description?: string;
|
||||||
|
image?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FulfillsPlan {
|
||||||
|
locLat?: number;
|
||||||
|
locLon?: number;
|
||||||
|
name?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Provider {
|
||||||
|
identifier?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ProvidedByPlan {
|
||||||
|
name?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FeedError {
|
||||||
|
userMessage?: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HomeView Component
|
* HomeView Component
|
||||||
*
|
*
|
||||||
@@ -987,7 +1028,7 @@ export default class HomeView extends Vue {
|
|||||||
* @param claim The claim object containing giver information
|
* @param claim The claim object containing giver information
|
||||||
* @returns The giver's DID
|
* @returns The giver's DID
|
||||||
*/
|
*/
|
||||||
private extractGiverDid(claim: any) {
|
private extractGiverDid(claim: Claim) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
return claim.agent?.identifier || (claim.agent as any)?.did;
|
return claim.agent?.identifier || (claim.agent as any)?.did;
|
||||||
}
|
}
|
||||||
@@ -998,7 +1039,7 @@ export default class HomeView extends Vue {
|
|||||||
* @internal
|
* @internal
|
||||||
* Called by processRecord()
|
* Called by processRecord()
|
||||||
*/
|
*/
|
||||||
private extractRecipientDid(claim: any) {
|
private extractRecipientDid(claim: Claim) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
return claim.recipient?.identifier || (claim.recipient as any)?.did;
|
return claim.recipient?.identifier || (claim.recipient as any)?.did;
|
||||||
}
|
}
|
||||||
@@ -1056,7 +1097,7 @@ export default class HomeView extends Vue {
|
|||||||
*/
|
*/
|
||||||
private shouldIncludeRecord(
|
private shouldIncludeRecord(
|
||||||
record: GiveSummaryRecord,
|
record: GiveSummaryRecord,
|
||||||
fulfillsPlan: any,
|
fulfillsPlan?: FulfillsPlan,
|
||||||
): boolean {
|
): boolean {
|
||||||
if (!this.isAnyFeedFilterOn) {
|
if (!this.isAnyFeedFilterOn) {
|
||||||
return true;
|
return true;
|
||||||
@@ -1090,7 +1131,7 @@ export default class HomeView extends Vue {
|
|||||||
* @internal
|
* @internal
|
||||||
* Called by processRecord()
|
* Called by processRecord()
|
||||||
*/
|
*/
|
||||||
private extractProvider(claim: any) {
|
private extractProvider(claim: Claim): Provider | undefined {
|
||||||
return Array.isArray(claim.provider) ? claim.provider[0] : claim.provider;
|
return Array.isArray(claim.provider) ? claim.provider[0] : claim.provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1100,7 +1141,7 @@ export default class HomeView extends Vue {
|
|||||||
* @internal
|
* @internal
|
||||||
* Called by processRecord()
|
* Called by processRecord()
|
||||||
*/
|
*/
|
||||||
private async getProvidedByPlan(provider: any) {
|
private async getProvidedByPlan(provider: Provider | undefined) {
|
||||||
return await getPlanFromCache(
|
return await getPlanFromCache(
|
||||||
provider?.identifier as string,
|
provider?.identifier as string,
|
||||||
this.axios,
|
this.axios,
|
||||||
@@ -1138,12 +1179,12 @@ export default class HomeView extends Vue {
|
|||||||
*/
|
*/
|
||||||
private createFeedRecord(
|
private createFeedRecord(
|
||||||
record: GiveSummaryRecord,
|
record: GiveSummaryRecord,
|
||||||
claim: any,
|
claim: Claim,
|
||||||
giverDid: string,
|
giverDid: string,
|
||||||
recipientDid: string,
|
recipientDid: string,
|
||||||
provider: any,
|
provider: Provider | undefined,
|
||||||
fulfillsPlan: any,
|
fulfillsPlan?: FulfillsPlan,
|
||||||
providedByPlan: any,
|
providedByPlan?: ProvidedByPlan,
|
||||||
): GiveRecordWithContactInfo {
|
): GiveRecordWithContactInfo {
|
||||||
return {
|
return {
|
||||||
...record,
|
...record,
|
||||||
@@ -1202,14 +1243,16 @@ export default class HomeView extends Vue {
|
|||||||
* @internal
|
* @internal
|
||||||
* Called by updateAllFeed()
|
* Called by updateAllFeed()
|
||||||
*/
|
*/
|
||||||
private handleFeedError(e: any) {
|
private handleFeedError(e: unknown) {
|
||||||
logger.error("Error with feed load:", e);
|
logger.error("Error with feed load:", e);
|
||||||
this.$notify(
|
this.$notify(
|
||||||
{
|
{
|
||||||
group: "alert",
|
group: "alert",
|
||||||
type: "danger",
|
type: "danger",
|
||||||
title: "Feed Error",
|
title: "Feed Error",
|
||||||
text: e.userMessage || "There was an error retrieving feed data.",
|
text:
|
||||||
|
(e as FeedError)?.userMessage ||
|
||||||
|
"There was an error retrieving feed data.",
|
||||||
},
|
},
|
||||||
-1,
|
-1,
|
||||||
);
|
);
|
||||||
|
|||||||