Problem with syncHistoricalData
Orange9000 opened this issue · comments
Hello. We're using react-native-qonversion 4.4.2
We're calling Qonversion.getSharedInstance().syncHistoricalData()
after module initialization. For some reason, it causes an apple login prompt to appear on a simulator, as well as on some real devices (App is downloaded from Testflight. One device so far). Cancelling this prompt results in Qonversion.getSharedInstance().checkEntitlements()
failing with error (checkEntitlements
is called later, after Qonversion module init and syncHistoricalData
). Devices obviously have a logged in Apple ID user.
Example error from xCode logs after login prompt is dismissed:
❌ Historical data sync failed: The operation couldn’t be completed. (SKErrorDomain error 2.)
Is this expected behaviour? Would this prompt appear when the app is in production?
![Screenshot 2023-07-11 at 09 27 13](https://private-user-images.githubusercontent.com/23454809/252571001-39f789a5-4718-4040-9171-4b5339cebced.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE1ODY3ODQsIm5iZiI6MTcyMTU4NjQ4NCwicGF0aCI6Ii8yMzQ1NDgwOS8yNTI1NzEwMDEtMzlmNzg5YTUtNDcxOC00MDQwLTkxNzEtNGI1MzM5Y2ViY2VkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIxVDE4MjgwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzMTBlYzk3MjIyZjNlOGU0YmFhMWQ1OWM3ZDlkODNkYzgwYTQzZTRlMjVlODFjYTFkMTQyMzc2OGU2MzQxNzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0iuVI3unSbuGSjW5Putr6xnwlJapjnwhxCprBp9AxDg)
Apparently, this window appears to users which have no linked payment method associated with their Apple ID.
Nonetheless, this shouldn't happen, since syncHistoricalData
runs for every user and I've no way of checking if they have a linked payment method.
Hi, @Orange9000
It's expected behavior. syncHistoricalData
is an analog of the restore
function you should have in your app following Apple guidelines. And in some cases, Apple may show that prompt and ask for the user credentials. When you call syncHistoricalData
, we check that this logic wasn't called yet for the current user and process it. Otherwise, we skip it. If you don't want to sync historical data, you can skip calling that function and let the user tap restore when they want. Unfortunately, avoiding that window is impossible because the logic that decides to show it or not is on the Apple side.
Hi, @Orange9000 It's expected behavior.
syncHistoricalData
is an analog of therestore
function you should have in your app following Apple guidelines. And in some cases, Apple may show that prompt and ask for the user credentials. When you callsyncHistoricalData
, we check that this logic wasn't called yet for the current user and process it. Otherwise, we skip it. If you don't want to sync historical data, you can skip calling that function and let the user tap restore when they want. Unfortunately, avoiding that window is impossible because the logic that decides to show it or not is on the Apple side.
Thank you for your reply. This is what we decided to go with. syncHistoricalData
will be manual for iOS users. For android users it will stay automatic and ran on app launch.