fix(ios): resolve build errors for daily notification plugin

- Add podspec file for daily notification plugin with correct name
  - Create TimesafariDailyNotificationPlugin.podspec to match Capacitor's
    expected naming convention
  - Podspec name must match Podfile reference for CocoaPods compatibility
- Update Podfile to reference TimesafariDailyNotificationPlugin
- Add automated fix script for podspec creation
  - scripts/fix-daily-notification-podspec.sh creates podspec with correct
    name before Capacitor sync
  - Integrated into build-ios.sh build process
- Fix typo in package.json: change "pina" to "pinia" (^2.1.7)

Fixes:
- Vite build error: "Failed to resolve import 'pinia'"
- CocoaPods error: "No podspec found for 'TimesafariDailyNotificationPlugin'"
- CocoaPods error: "The name of the given podspec doesn't match the expected one"

The podspec file is created automatically during the build process to ensure
Capacitor sync can find the plugin with the expected name, while maintaining
compatibility with the actual podspec file name in the plugin package.
This commit is contained in:
Jose Olarte III
2026-01-22 18:03:14 +08:00
parent 14ffcb5434
commit 84c3f79c57
6 changed files with 1550 additions and 2052 deletions

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# Fix Daily Notification Plugin Podspec Name
# Creates a podspec with the expected name for Capacitor sync
PLUGIN_DIR="node_modules/@timesafari/daily-notification-plugin"
PODSPEC_ACTUAL="CapacitorDailyNotification.podspec"
PODSPEC_EXPECTED="TimesafariDailyNotificationPlugin.podspec"
if [ -f "$PLUGIN_DIR/$PODSPEC_ACTUAL" ] && [ ! -f "$PLUGIN_DIR/$PODSPEC_EXPECTED" ]; then
echo "Creating podspec: $PODSPEC_EXPECTED"
cat > "$PLUGIN_DIR/$PODSPEC_EXPECTED" << 'EOF'
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'TimesafariDailyNotificationPlugin'
s.version = package['version']
s.summary = package['description']
s.license = package['license']
s.homepage = package['repository']['url']
s.author = package['author']
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
s.ios.deployment_target = '13.0'
s.dependency 'Capacitor'
s.swift_version = '5.1'
end
EOF
echo "✓ Podspec created successfully"
elif [ -f "$PLUGIN_DIR/$PODSPEC_EXPECTED" ]; then
echo " Podspec already exists"
else
echo "⚠ Actual podspec not found at $PLUGIN_DIR/$PODSPEC_ACTUAL"
fi