push icon indicating copy to clipboard operation
push copied to clipboard

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

Open deniza opened this issue 1 year ago • 0 comments

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

deniza avatar Dec 17 '24 08:12 deniza