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

[Bug]: App Crash when notifications permission is requested [iOS] #88

Open
1 task done
wilsonvargas opened this issue Jan 11, 2024 · 1 comment
Open
1 task done

Comments

@wilsonvargas
Copy link

wilsonvargas commented Jan 11, 2024

What happened?

We have installed OneSignal.DotNet version 5.0.2, and when attempting to request notification permissions using the following code:

OneSignal.Debug.LogLevel = LogLevel.VERBOSE;
OneSignal.Initialize(UniversalSettings.TokenNotification);
await OneSignal.Notifications.RequestPermissionAsync(true);

The application fails to function properly when requesting permissions, but only when it is published in the store.

Xamarin 4.8.0.1560

Steps to reproduce?

1. Install OneSignal.DotNet version 5.0.2.
2. Implement the permission request code mentioned in the application.
3. Publish the application to the store.
4. Observe that the application fails to request notification permissions in the published version.

What did you expect to happen?

The expected behavior is that the application successfully requests notification permissions without encountering any issues.

Relevant log output

["System.InvalidCastException: Unable to cast object of type 'Com.OneSignal.iOS.OSUser' to type 'Com.OneSignal.iOS.OSPushSubscription'.
  at ObjCRuntime.Runtime.GetNSObject[T] (System.IntPtr ptr) <0x106c5a3f0 + 0x00340> in <153620f857f54f9c9ab1e7a1e6853772#6b0a719b7c6e7d2ec24f13fb5be23ed5>:0 
  at Com.OneSignal.iOS.OSUser.get_PushSubscription () <0x1085b8b90 + 0x00053> in <d128b549342e4c12912477e6743b6ef0#6b0a719b7c6e7d2ec24f13fb5be23ed5>:0 
  at OneSignalSDK.DotNet.iOS.iOSPushSubscription.Initialize () <0x1085a0060 + 0x0007b> in <3846e65d363147fd849ba2d047a0f674#6b0a719b7c6e7d2ec24f13fb5be23ed5>:0 
  at OneSignalSDK.DotNet.iOS.iOSUserManager.Initialize () <0x10859f970 + 0x0004f> in <3846e65d363147fd849ba2d047a0f674#6b0a719b7c6e7d2ec24f13fb5be23ed5>:0 
  at OneSignalSDK.DotNet.iOS.iOSOneSignal.Initialize (System.String appId) <0x10859f3a0 + 0x000a3> in <3846e65d363147fd849ba2d047a0f674#6b0a719b7c6e7d2ec24f13fb5be23ed5>:0 
  at OneSignalSDK.DotNet.OneSignal.Initialize (System.String appId) <0x108596470 + 0x0003b> in <52693c75245f439194c30e607db2a9cb#6b0a719b7c6e7d2ec24f13fb5be23ed5>:0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@emawby
Copy link
Contributor

emawby commented Jan 16, 2024

@wilsonvargas Thank you for reporting we are investigating

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

2 participants