OneSignal / OneSignal-iOS-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496 stars 263 forks source link

Add refresh_device_metadata to create user so country / IP can be set #1339

Closed nan-li closed 11 months ago

nan-li commented 1 year ago

Description

One Line Summary

Add refresh_device_metadata to create user so country and IP can be set for the new user.

Details

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.

Motivation

This flag was added to the create user endpoint and while missing country / IP didn't affect iOS as it did Android, because iOS made a followup session call immediately, let's still add this to our create user request for consistency.

Scope

Country and IP are based on where the request originated from. This change is not really necessary for iOS due to differing behavior but consistency-wise and future proofing, it is good to have this flag on the create user request.

Testing

Unit testing

None

Manual testing

iPhone 13 iOS 17.1

Affected code checklist

Checklist

Overview

Testing

Final pass


This change is Reviewable