I have a cross-platform application and want to introduce auto-renewing subscriptions. However, since the app is cross platform, I have set-up subscriptions with free trials on iOS and Android using StoreKit and Billing.
Consider this scenario: A user has initialised a free trial in the Android app and I track that it in my backend database. The user now cancels the subscription within the free trial and the user uses the subscription benefits till the end of the free trial. By the end of the trial I can read the receipt from Billing and know that his free trial has ended.
But in the scenario where he logs in into an iPhone, I can fetch the subscription data from the backend DB and know that the user has consumed his free trial. However, I cannot prevent the user from accessing the App Store's free trial since I can't mutate the payment request made to App Store. Is there a way to do this?
One workaround I thought of was having two subscriptions one with and one without the free trial. And the client will fetch the data from the backend to figure out whether a user has availed the free trial and filter it locally. Is there a more direct solution without creating two variants of every subscription?