feat(android): add runtime starred plans management API
- Add updateStarredPlans() method to update plan IDs from TimeSafari app - Stores plan IDs in SharedPreferences for persistence - Integrated with TimeSafariIntegrationManager for prefetch operations - Includes comprehensive logging for debugging - Add getStarredPlans() method to retrieve current stored plan IDs - Allows TimeSafari app to verify synchronization - Returns count and last update timestamp - Update TimeSafariIntegrationManager to load starred plan IDs - Reads from SharedPreferences when building TimeSafariUserConfig - Used automatically by EnhancedDailyNotificationFetcher for API calls - Enables dynamic updates without requiring app restart - Add TypeScript definitions for new methods - Includes JSDoc documentation for integration guidance - Matches Android implementation return types - Create integration example for TimeSafari app - Shows how to sync plan IDs from account settings - Demonstrates star/unstar action handling - Includes verification and error handling patterns This allows the TimeSafari app to dynamically update starred project IDs when users star or unstar projects, without requiring plugin configuration changes or app restarts. The stored IDs are automatically used by the prefetch system to query for project updates.
This commit is contained in:
@@ -374,6 +374,38 @@ export interface DailyNotificationPlugin {
|
||||
clearCacheForNewIdentity(): Promise<void>;
|
||||
updateBackgroundTaskIdentity(activeDid: string): Promise<void>;
|
||||
|
||||
// Starred Plans Management Methods
|
||||
/**
|
||||
* Update starred plan IDs from host application
|
||||
*
|
||||
* This allows the TimeSafari app to dynamically update the list of starred
|
||||
* project IDs when users star or unstar projects. The IDs are stored persistently
|
||||
* and used for prefetch operations that query for starred project updates.
|
||||
*
|
||||
* @param options Contains:
|
||||
* - planIds: string[] - Array of starred plan handle IDs
|
||||
* @returns Promise with success status and plan count
|
||||
*/
|
||||
updateStarredPlans(options: { planIds: string[] }): Promise<{
|
||||
success: boolean;
|
||||
planIdsCount: number;
|
||||
updatedAt: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Get current starred plan IDs
|
||||
*
|
||||
* Returns the currently stored starred plan IDs from SharedPreferences.
|
||||
* This is useful for the host app to verify what IDs are stored.
|
||||
*
|
||||
* @returns Promise with current starred plan IDs
|
||||
*/
|
||||
getStarredPlans(): Promise<{
|
||||
planIds: string[];
|
||||
count: number;
|
||||
updatedAt: number;
|
||||
}>;
|
||||
|
||||
// Content Fetching Methods
|
||||
/**
|
||||
* Trigger an immediate standalone fetch for content updates
|
||||
|
||||
Reference in New Issue
Block a user