Release 1.3.0: onboarding UX, charts paywall banner, re-engagement notifications, Crashlytics

- Crashlytics: add FirebaseCrashlytics framework + dSYM upload build phase
- Onboarding: useSampleData off by default, Add First Investment as primary CTA
- AddSourceView: contextual placeholder and footer explaining what a source is
- Charts: CompactPaywallBanner visible to free users on every visit
- Notifications: re-engagement (7d) and monthly check-in local notifications
- Paywall: decorative chart preview replacing static crown icon
- Localization: all new strings in en + es-ES
This commit is contained in:
alexandrev-tibco
2026-05-01 09:26:37 +02:00
parent 10f6d0ca20
commit 94ed4d17eb
11 changed files with 340 additions and 131 deletions
@@ -1,5 +1,93 @@
import SwiftUI
// MARK: - Chart Preview (decorative, no real data)
private struct PremiumChartPreview: View {
// Normalized growth data representing a healthy upward portfolio trend
private let points: [Double] = [0.52, 0.58, 0.55, 0.65, 0.70, 0.66, 0.78, 0.85, 0.82, 0.91, 0.88, 1.0]
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 12)
.fill(Color.appPrimary.opacity(0.08))
VStack(alignment: .leading, spacing: 0) {
HStack(alignment: .firstTextBaseline) {
Text("€24,750")
.font(.system(size: 18, weight: .bold, design: .rounded))
.foregroundColor(.primary)
Spacer()
Text("+34.2%")
.font(.caption.weight(.semibold))
.foregroundColor(.positiveGreen)
.padding(.horizontal, 7)
.padding(.vertical, 3)
.background(Color.positiveGreen.opacity(0.12))
.clipShape(Capsule())
}
.padding(.horizontal, 14)
.padding(.top, 12)
.padding(.bottom, 6)
GeometryReader { geo in
chartPaths(in: geo.size)
}
.padding(.bottom, 8)
}
}
.frame(height: 96)
}
@ViewBuilder
private func chartPaths(in size: CGSize) -> some View {
let pts = chartPoints(in: size)
// Gradient fill
Path { path in
guard !pts.isEmpty else { return }
path.move(to: CGPoint(x: pts[0].x, y: size.height))
path.addLine(to: pts[0])
for i in 1..<pts.count {
let ctrl = CGPoint(x: (pts[i-1].x + pts[i].x) / 2, y: (pts[i-1].y + pts[i].y) / 2)
path.addQuadCurve(to: pts[i], control: ctrl)
}
path.addLine(to: CGPoint(x: pts.last!.x, y: size.height))
path.closeSubpath()
}
.fill(LinearGradient(
colors: [Color.appPrimary.opacity(0.25), Color.appPrimary.opacity(0.0)],
startPoint: .top, endPoint: .bottom
))
// Line
Path { path in
guard !pts.isEmpty else { return }
path.move(to: pts[0])
for i in 1..<pts.count {
let ctrl = CGPoint(x: (pts[i-1].x + pts[i].x) / 2, y: (pts[i-1].y + pts[i].y) / 2)
path.addQuadCurve(to: pts[i], control: ctrl)
}
}
.stroke(Color.appPrimary, lineWidth: 2)
// Last point dot
if let last = pts.last {
Circle()
.fill(Color.appPrimary)
.frame(width: 7, height: 7)
.position(last)
}
}
private func chartPoints(in size: CGSize) -> [CGPoint] {
guard points.count > 1 else { return [] }
let stepX = size.width / CGFloat(points.count - 1)
return points.enumerated().map { i, val in
CGPoint(x: CGFloat(i) * stepX, y: size.height * (1.0 - val * 0.85))
}
}
}
struct PaywallView: View {
@Environment(\.dismiss) private var dismiss
@EnvironmentObject var iapService: IAPService
@@ -68,27 +156,7 @@ struct PaywallView: View {
private var headerSection: some View {
VStack(spacing: 12) {
ZStack {
Circle()
.fill(
LinearGradient(
colors: [Color.yellow.opacity(0.25), Color.orange.opacity(0.25)],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
)
.frame(width: 72, height: 72)
Image(systemName: "crown.fill")
.font(.system(size: 30))
.foregroundStyle(
LinearGradient(
colors: [.yellow, .orange],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
)
}
PremiumChartPreview()
Text("Your full portfolio,\nfully clear")
.font(.title.weight(.bold))