setReverseProxy
See also
Routes all SDK network requests through the specified reverse proxy URL and sets custom HTTP headers for all requests. Settings are not persisted and must be set on every app start.
Requirescom.pushwoosh.allow_reverse_proxy meta-data set to true in AndroidManifest.xml:
<meta-data android:name="com.pushwoosh.allow_reverse_proxy" android:value="true" />
Important: This method must be called in Application.onCreate(), not in Activity.onCreate(). The SDK initializes automatically via ContentProvider before your Application class is created. Calling this method in Application.onCreate() guarantees that the reverse proxy URL is set before any SDK network requests are sent.
// Enable reverse proxy with custom headers
Map<String, String> headers = new HashMap<>();
headers.put("X-Proxy-Auth", "my-token");
Pushwoosh.getInstance().setReverseProxy("https://your-proxy.example.com/json/1.3/", headers);
The URL is validated and normalized before it is applied. A rejected URL is ignored: the previously configured proxy stays in place and the reason is written to the log.
Parameters
the reverse proxy URL (must be a valid https:// or http:// URL)
optional map of custom HTTP headers (may be null)