from firebase_admin import messaging

def send_push_notification(token: str, title: str, body: str, data: dict = None):
    """
    Send FCM notification to a specific device token.
    """
    try:
        message = messaging.Message(
            notification=messaging.Notification(title=title, body=body),
            data=data or {},
            token=token,
        )
        response = messaging.send(message)
        print(f"✅ FCM push sent successfully: {response}")
        return True
    except Exception as e:
        print(f"⚠️ FCM push failed: {e}")
        return False
