diff --git a/src/components/promotions/CampaignManager.tsx b/src/components/promotions/CampaignManager.tsx index 8caad7fa..c5e1b864 100644 --- a/src/components/promotions/CampaignManager.tsx +++ b/src/components/promotions/CampaignManager.tsx @@ -205,9 +205,22 @@ export const CampaignManager: React.FC = () => { }, 350); // Wait for exit animation }, []); - const handleAction = (action: CampaignAction) => { + const handleAction = useCallback((action: CampaignAction) => { console.log('[CampaignManager] Action:', action); - }; + + if (action.type === 'navigate' && action.value) { + handleDismiss(); + setTimeout(() => { + try { + (navigation as any).navigate(action.value); + } catch (error) { + console.warn('[CampaignManager] Navigation failed:', error); + } + }, 400); + } else if (action.type === 'link' && action.value) { + Linking.openURL(action.value); + } + }, [navigation, handleDismiss]); if (!activeCampaign || !isVisible) return null; diff --git a/src/services/campaignService.ts b/src/services/campaignService.ts index 47a90b75..aad80bb7 100644 --- a/src/services/campaignService.ts +++ b/src/services/campaignService.ts @@ -1,7 +1,7 @@ import { mmkvStorage } from './mmkvStorage'; import { Platform } from 'react-native'; -const DEV_URL = 'http://192.168.1.5:3000'; +const DEV_URL = 'https://campaign.nuvioapp.space/'; const PROD_URL = process.env.EXPO_PUBLIC_CAMPAIGN_API_URL || ''; const CAMPAIGN_API_URL = __DEV__ ? DEV_URL : PROD_URL;