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

iOS: requestPermission Function Crashes iOS Apps Running on macOS (Catalyst) #72

Open
deniza opened this issue Dec 17, 2024 · 0 comments

Comments

@deniza
Copy link

deniza commented Dec 17, 2024

Description:
When running an iOS application on macOS, by downloading it from macOS App Store, the requestPermission function from the plugin causes the application to crash. This issue only occurs under Catalyst on macOS; the function works as expected when running the app directly on iOS.

Workaround:
For applications targeting macOS via Catalyst, avoid calling requestPermission or implement a platform-specific check to prevent the function from running on macOS:

if (!isCatalyst()) {
  Push.instance.requestPermission();
}

You can use a plugin such as flutter_is_ios_app_on_mac to detect if the app is running on macOS via Catalyst.

Additional Information:

  • Plugin version: 2.3.0
  • Flutter version: 3.24.5
  • macOS version: Sonoma 14.6.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant