OneSignal / OneSignal-DotNet-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your .NET app with OneSignal. https://onesignal.com
MIT License
16 stars 5 forks source link

[Bug]: iOSNotificationsManager.RequestPermissionAsync #81

Open TryLastOne opened 10 months ago

TryLastOne commented 10 months ago

What happened?

iOSNotificationsManager.RequestPermissionAsync (System.Boolean fallbackToSettings) System.ExecutionEngineException: Attempting to JIT compile method 'void Com.OneSignal.iOS.OSNotifications:RequestPermission (Com.OneSignal.iOS.OSUserResponseBlock,bool)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

Steps to reproduce?

1) Create Xamarin.Forms app.
2) Add OneSignalSDK.DotNet packages for iOS, Android and Shared projects.
3) Build Release with Linked SDK assemblies, then deploy iOS app to iPhone device.
4) Run App.
5) Call RequestPermissionAsync will get the error.

What did you expect to happen?

Show notification prompt on iOS app.

Relevant log output

No response

Code of Conduct

shepherd-l commented 10 months ago

What version of Xcode and .Net are you using?

Are you using a Mac or Windows machine?

Are you able to reproduce the error on Debug builds?

TryLastOne commented 10 months ago

Hey @shepherd-l, Thank you for your response.

What version of Xcode and .Net are you using?

== > .NET Core SDK: 6.0.417, 7.0.102, 7.0.202, 7.0.306, 7.0.404, 8.0.100 Xcode 14.2 Build 14C18 Xamarin.Mono: 6.12 Xamarin.iOS: 16.2

Are you using a Mac or Windows machine?

==> MacOS 12.7.1 (21G920) on Intel Chip X64. Build configruation: Release

Are you able to reproduce the error on Debug builds? ==> not tried to build with Debug.

Additional information: The same project built on the latest MacOS (Sonoma), Xcode (15.0.1), Mono (6.12.0.188), Xamarin.iOS (16.4.0.23) and Release configuration on M2 chip (ARM64), the issue was not happened.

emawby commented 8 months ago

@TryLastOne I am not able to reproduce this issue but it seems similar to these https://github.com/xamarin/xamarin-macios/issues/12416 https://github.com/dotnet/maui/issues/7396 The newer releases of this SDK will be using the .net7 build tool chain instead of the legacy Xamarin build tools.