qonversion / qonversion-ios-sdk

iOS SDK for cross-platform in-app purchase and subscription infrastructure, revenue analytics, engagement automation, and integrations
https://qonversion.io
MIT License
282 stars 23 forks source link

Proper macOS support for API identities #542

Open megastep opened 2 months ago

megastep commented 2 months ago

I have several universal iOS / macOS apps (not Catalyst - separate apps with a common code base). When running the macOS version, I get a bunch of these errors in the console:

❌ Request failed: https://api.qonversion.io/v2/identities, error: Error Domain=com.qonversion.io.api Code=3 "wrong platform" UserInfo={NSLocalizedDescription=wrong platform}

I believe the SDK sends the "macOS" platform to the API, which in turn returns this failure. This creates downstream issues as I think it prevents my users from being identified properly and re-associated with their other accounts.

It sounds like an easy fix would be to simply allow the backend to recognize macOS platform values, as otherwise all of the SDK compiles and is functional, and can process purchases, etc.

megastep commented 2 months ago

In a fork, I tried manually overriding the platform values defined in QNINternalConstants.m.

The errors go away if I make it pretend to be iOS - doesn't work even with the macCatalyst values. I may have to keep using this fork as a workaround in the meantime.

suriksarkisyan commented 2 months ago

Hi, @megastep I will discuss with the team and get back to you as soon as there are any updates!

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.

megastep commented 1 month ago

was there any resolution on this?

suriksarkisyan commented 1 month ago

Hello, @megastep . The solution you provided above will work for now, even though it’s not ideal. The issue is that you need to ensure this change isn’t lost after the pod install. As for a proper solution, I’ve passed the task to the team to fix the problem. I can’t say exactly when it will be ready, but I will definitely get back to you with an update as soon as we release the fix.

megastep commented 1 month ago

I am using my patched fork with the Swift Package Manager so no worries for now. I'd love to know when I can safely switch back to the mainstream package though...