You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am sending notification through REST API, it was working fine with OneSignal 3.x, but when updated to 4.0.0 beta 3, it crashes with following stack trace.
Environment
Xamarin.iOS
Com.OneSignal 4.0.0-beta3 from Nuget
Steps to Reproduce Issue:
Example:
Add version 4.0.0 beta 3 of the Xamarin SDK to your project
Initialize the SDK with your App ID
Attempt to receive a push notification
Anything else:
System.NullReferenceException: Object reference not set to an instance of an object
at Foundation.NSNumber.op_Explicit (Foundation.NSNumber source) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSNumber2.cs:117
at Com.OneSignal.NativeConversion.NotificationToXam (Com.OneSignal.iOS.OSNotification notification) [0x00000] in /Users/tanay/Desktop/Xamarin_SDK/OneSignal_Xamarin-4_0_0/OneSignal-Xamarin-SDK/Com.OneSignal.iOS/Utilities/NativeConversion.cs:41
at Com.OneSignal.OneSignalImplementation+<>c.<.ctor>b__99_0 (Com.OneSignal.iOS.OSNotification nativeNotification, Com.OneSignal.iOS.OSNotificationDisplayResponse response) [0x00014] in /Users/tanay/Desktop/Xamarin_SDK/OneSignal_Xamarin-4_0_0/OneSignal-Xamarin-SDK/Com.OneSignal.iOS/OneSignalCallbacks.cs:54
at ObjCRuntime.Trampolines+SDOSNotificationWillShowInForegroundBlock.Invoke (System.IntPtr block, System.IntPtr arg0, System.IntPtr arg1) [0x00016] in /Users/tanay/Desktop/Xamarin_SDK/OneSignal_Xamarin-4_0_0/OneSignal-Xamarin-SDK/OneSignal.iOS.Binding/obj/Release/iOS/ObjCRuntime/Trampolines.g.cs:298
at (wrapper native-to-managed) ObjCRuntime.Trampolines+SDOSNotificationWillShowInForegroundBlock.Invoke(intptr,intptr,intptr)
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:73
at KidsTime.iOS.Application.Main (System.String[] args) [0x00002] in /Users/immons/Projects/KidsTime/KidsTime.iOS/Main.cs:18
The text was updated successfully, but these errors were encountered:
additionalData = Json.Deserialize(notification.AdditionalData.ToString()) as Dictionary<string, object>,
it "deserializes" to null, the solution could be code from your 3.10 implementation:
var additionalData = new Dictionary<string, object>();
if (notification.AdditionalData != null)
{
foreach (KeyValuePair<NSObject, NSObject> element in notification.AdditionalData)
{
additionalData.Add((NSString)element.Key, element.Value);
}
}
Description:
I am sending notification through REST API, it was working fine with OneSignal 3.x, but when updated to 4.0.0 beta 3, it crashes with following stack trace.
Environment
Steps to Reproduce Issue:
Example:
Anything else:
The text was updated successfully, but these errors were encountered: