Skip to content

Commit 012330b

Browse files
nan-lijinliu9508
authored andcommitted
add refresh_device_metadata to create user request
When the server receives a create user request, it doesn't automatically update IP and country for this user because this request can come from the SDK or from the customer's server. By passing in a `refresh_device_metadata = true` property to the request body, we can let the server know to update IP and country based on where the request originated from.
1 parent 473ca90 commit 012330b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

OneSignalSDK/onesignal/core/src/main/java/com/onesignal/user/internal/backend/impl/UserBackendService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ internal class UserBackendService(
3434
requestJSON.put("properties", JSONObject().putMap(properties))
3535
}
3636

37+
requestJSON.put("refresh_device_metadata", true)
38+
3739
val response = _httpClient.post("apps/$appId/users", requestJSON)
3840

3941
if (!response.isSuccess) {

0 commit comments

Comments
 (0)