SDK IOS error. I need help please.
# support
j
Hi there, I need help please!Issue Description I'm encountering a consistent decoding error when attempting to start a call with the VAPI SDK in my iOS app. The server successfully creates the call and returns a response containing all the required data, but the SDK fails to decode this response with the error: "The data couldn't be read because it is missing." Implementation Details: My implementation follows the documented approach: // Initialize VAPI vapi = Vapi(publicKey: Config.vapiAPIKey) // Start a call try await vapi.start(assistantId: "71f9f846-71f6-4fb8-81ff-96d359e612ed") Detailed Error Response The full error looks like this: decodingError(message: "The data couldn't be read because it is missing.", response: Optional("{\"metadata\":{},\"id\":\"d24ad405-cba2-449a-a984-ef45b03b318f\",\"orgId\":\"9c518ca3-029e-4cf1-b818-7e1d1f50fa35\",\"createdAt\":\"2025-04-08T08:29:58.072Z\",\"updatedAt\":\"2025-04-08T08:29:58.072Z\",\"type\":\"webCall\",\"monitor\":{\"listenUrl\":\"wss://phone-call-websocket.aws-us-west-2-backend-production1.vapi.ai/d24ad405-cba2-449a-a984-ef45b03b318f/listen\",\"controlUrl\":\"https://phone-call-websocket.aws-us-west-2-backend-production1.vapi.ai/d24ad405-cba2-449a-a984-ef45b03b318f/control\"},\"transport\":{\"assistantVideoEnabled\":false},\"webCallUrl\":\"https://vapi.daily.co/eEiuMOMlWOTvDK6fr6ih\",\"status\":\"queued\",\"assistantId\":\"71f9f846-71f6-4fb8-81ff-96d359e612ed\",\"assistantOverrides\":{},\"artifactPlan\":{}}")) The error appears to be contradictory - it says "data couldn't be read because it is missing" but the error itself contains a complete-looking JSON response with all the expected fields including webCallUrl, assistantId, etc. Request Could you please: 1. Confirm if this is a known issue 2. Advise if there's an updated SDK version that addresses this issue 3. Provide guidance on the best approach to handle this decoding error Thank you for your assistance! #1211483291191083018
v
Hi there! 👋 Sorry to hear you're running into issues with the VAPI iOS SDK. I'm unable to definitively confirm if this is a known issue or if there's an updated SDK version that specifically addresses this decoding error. However, I can definitely help with troubleshooting approaches! Based on the information I found, here are some steps you can take to handle this decoding error: ### General Troubleshooting Steps - Double-check your API key to ensure it's correct and hasn't expired - Review any recent code changes that might have affected the SDK's functionality - Test in a different environment to rule out device-specific issues - Check that you're using the latest version of the VAPI iOS SDK from [GitHub](https://github.com/VapiAI/ios) ### Specific to Your Error Since your error shows "The data couldn't be read because it is missing" but includes a complete JSON response, this suggests a potential mismatch between the expected data structure and what's being returned. Some possible causes: 1. **Check the SDK Version**: Make sure you're using the most recent version of the SDK from the [VAPI iOS GitHub repository](https://github.com/VapiAI/ios) 2. **Verify the `listenUrl`**: According to documentation, you can test the WebSocket URL directly:
Copy code
sh
   wscat -c wss://phone-call-websocket.aws-us-west-2-backend-production1.vapi.ai/d24ad405-cba2-449a-a984-ef45b03b318f/listen
3. **Investigate JSON Structure**: The error suggests the SDK might be expecting a field that's missing in the response, despite the response looking complete ### Contact VAPI Support If the above steps don't resolve the issue, contacting VAPI support is recommended. When reaching out, include: - Your organization ID (which appears to be
9c518ca3-029e-4cf1-b818-7e1d1f50fa35
) - The call ID (
d24ad405-cba2-449a-a984-ef45b03b318f
) - The exact error message and JSON response you shared - Timestamps of when the error occurred - Any code snippets showing your implementation
s
Hey, could you share the steps to reproduce this and the error stack trace along with the logs? So I can try to understand what might have gone wrong for you.