Network access
Web plugins request services through standard APIs such as fetch. GMP provides no direct networking API.
Connect your own service#
- Declare network in the Web manifest only when needed.
- Use HTTPS services and restrict allowed origins in the frontend deployment policy.
- Configure server-side CORS correctly. Opening a website in a page does not mean fetch can read its content across origins.
- Support request cancellation and timeouts. End tasks when the application stops or enters a state unsuitable for the request.
Separate network and hardware paths#
The phone page requests business-service data, then sends it to the glasses through display APIs or declared plugin messages. Do not treat a server address as a GMP hardware API or use Studio's installation IP as your business API.
Your HTTPS service ⇄ Web plugin (fetch)
│ PhoneSDK Bridge
▼
App → Bluetooth → GlassesTroubleshooting failed requests#
- Confirm that the phone can reach the service and that the domain and certificate are correct.
- Confirm that the current package declares network, the App has authorized it, and the page's CSP allows the origin.
- Check server CORS responses, timeouts, and business status codes.
- Studio networking and the App's native-container restrictions differ. Test again on the target phone.
Connect your cloud service or AI capability#
The current PhoneSDK has no general-purpose large-model, transcription, or recognition service API. Implement these features by having the Web plugin call your own service, then send results to the glasses through public display or messaging APIs.
- Keep long-lived service keys on the server. GMP, Web JavaScript, and manifests are unsuitable for storing these credentials.
- Keep a task ID for each long-running task, with cancellation, timeout, and status-query support. After the phone page is recreated, recover from server-side results.
- Provide clear feedback for empty results, service unavailability, and uncertain results. Do not leave the glasses showing “Processing” indefinitely.
- Before sending text, files, or audio to an external service, explain the purpose and destination. Send only the data needed for the current feature.
Reference files in the toolkit#
- PhoneSDK/examples/permission-debug/plugin.js
- PhoneSDK/packages/bridge-contract/src/permission-policy.js