Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for iOS App Extensions #81

Open
mikhailChelbaev opened this issue Mar 26, 2024 · 3 comments
Open

Support for iOS App Extensions #81

mikhailChelbaev opened this issue Mar 26, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@mikhailChelbaev
Copy link

Currently, subscription data cannot be shared between the main app and extensions because internally you store profile data in the UserDefaults.standard. As a result, each extension must individually fetch subscription status.

To address this issue, you can include a userDefaults parameter in the Adapty.activate method, allowing the profile data to be stored in an app group.

Adapty.activate(
  "adapty-api-key",
  customerUserId: "user-id",
  userDefaults: .init(suiteName: "group.com.example")
)
@x401om
Copy link
Contributor

x401om commented Mar 27, 2024

Hi, @mikhailChelbaev! Could you please specify your usecase? Are you trying to check user's subscription status within extension or something more?

@mikhailChelbaev
Copy link
Author

I have an app with a keyboard extension. Many features in the keyboard extension are available only for premium users. Therefore, I need to verify the subscription status from this extension.

Although the current setup allows me to perform this check as the keyboard has internet access, it would be more convenient if the app and the extension could share the state. This synchronization would ensure that users experience consistent behavior across both the app and the keyboard.

@x401om
Copy link
Contributor

x401om commented Mar 28, 2024

@mikhailChelbaev, I would recommend synchronizing the subscription status using shared memory on your own rather than relying on the Adapty SDK within the extension. There can be unexpected behaviors otherwise.

Thank you for highlighting your use case; we will certainly consider adding support for extensions in the future. However, I cannot provide any estimate at this time.

@x401om x401om added the enhancement New feature or request label Apr 10, 2024
@x401om x401om changed the title Share data between the main app and extensions Support for iOS App Extensions Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants