Add push notification deep linking and sharing subscription checks
- Add deep link navigation from push notifications to specific task column on kanban board - Fix subscription check in push notification handler to allow navigation when limitations disabled - Add pendingNavigationTaskId to handle notifications when app isn't ready - Add ScrollViewReader to AllTasksView for programmatic scrolling to task column - Add canShareResidence() and canShareContractor() subscription checks (iOS & Android) - Add test APNS file for simulator push notification testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -267,6 +267,50 @@ object SubscriptionHelper {
|
||||
return UsageCheck(true, null)
|
||||
}
|
||||
|
||||
// ===== RESIDENCE SHARING =====
|
||||
|
||||
/**
|
||||
* Check if user can share a residence (Pro feature).
|
||||
* Returns true (blocked) when limitations are ON and user is not pro.
|
||||
*/
|
||||
fun canShareResidence(): UsageCheck {
|
||||
val subscription = SubscriptionCache.currentSubscription.value
|
||||
?: return UsageCheck(true, null) // Allow if no subscription data (fallback)
|
||||
|
||||
if (!subscription.limitationsEnabled) {
|
||||
return UsageCheck(true, null) // Limitations disabled, allow everything
|
||||
}
|
||||
|
||||
if (currentTier == "pro") {
|
||||
return UsageCheck(true, null) // Pro tier can share
|
||||
}
|
||||
|
||||
// Free users cannot share residences
|
||||
return UsageCheck(false, "share_residence")
|
||||
}
|
||||
|
||||
// ===== CONTRACTOR SHARING =====
|
||||
|
||||
/**
|
||||
* Check if user can share a contractor (Pro feature).
|
||||
* Returns true (blocked) when limitations are ON and user is not pro.
|
||||
*/
|
||||
fun canShareContractor(): UsageCheck {
|
||||
val subscription = SubscriptionCache.currentSubscription.value
|
||||
?: return UsageCheck(true, null) // Allow if no subscription data (fallback)
|
||||
|
||||
if (!subscription.limitationsEnabled) {
|
||||
return UsageCheck(true, null) // Limitations disabled, allow everything
|
||||
}
|
||||
|
||||
if (currentTier == "pro") {
|
||||
return UsageCheck(true, null) // Pro tier can share
|
||||
}
|
||||
|
||||
// Free users cannot share contractors
|
||||
return UsageCheck(false, "share_contractor")
|
||||
}
|
||||
|
||||
// ===== DEPRECATED - Keep for backwards compatibility =====
|
||||
|
||||
@Deprecated("Use isContractorsBlocked() instead", ReplaceWith("isContractorsBlocked()"))
|
||||
|
||||
Reference in New Issue
Block a user