OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104 stars 50 forks source link

SetExternalUserId - System.ArgumentNullException: Value cannot be null. Parameter name: hashToken #321

Closed ChrisMonson closed 1 year ago

ChrisMonson commented 1 year ago

Description: Attempting to set an external user id through OneSignal.Default.SetExternalUserId without supplying a hash token on iOS continues to throw an exception even after updating to v4.1.1. Looking at the change made in v4.1.1 it looks as though there is supposed to be a method overload for SetExternalUserId that does not have the optional hash token. This does not appear to be available in the actual v4.1.1 library. Rolling back to previous versions of the SDK has not fixed it as the issue seems to have been added in v4.0.0.

We are completely stuck on this issue right now and have had to give up on integrating OneSignal until this gets fixed.

Environment OneSignalSDK.Xamarin v4.1.1 installed via nuget Visual Studio for Mac 2022 v17.0.6 Xamarin.iOS v15.10.0.5

Steps to Reproduce Issue:

  1. Install OneSignalSDK.Xamarin v4.1.1
  2. Configure following OneSignal documentation
  3. Attempt to call OneSignal.Default.SetExternalUserId("SomeExternalUserId")

Anything else:

Decompiled v4.1.1 OneSignalSDKInternal class showing no overload for SetExternalUserId without hashtoken OneSignal.Xamarin.Core.OneSignalSDKInternal.txt

Stack Trace: System.ArgumentNullException: Value cannot be null. Parameter name: hashToken File "/Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/ThrowHelper.cs", line 28, col 4, in void ThrowHelper.ThrowArgumentNullException(string argumentName) File "/Users/tanay/Desktop/OneSignal/OneSignal-Xamarin-SDK/OneSignal.iOS.Binding/obj/Release/iOS/Com.OneSignal.iOS/OneSignal.g.cs", line 978, col 5, in void OneSignal.SetExternalUserId(string externalId, string hashToken, OSUpdateExternalUserIdSuccessBlock successBlock, OSUpdateExternalUserIdFailureBlock failureBlock) File "/Users/tanay/Desktop/OneSignal/OneSignal-Xamarin-SDK/OneSignalSDK.Xamarin.iOS/OneSignalImplementation.cs", line 152, col 10, in async Task OneSignalImplementation.SetExternalUserId(string externalId, string authHash) File "/Users/cmonson/Documents/Development/Avanlee Care/avanleeapp/AvanleeApp/AvanleeApp/Models/AttributeTagging.cs", line 227, col 13, in async Task AttributeTagging.SetExternalUserId(string externalUserId) File "/Users/cmonson/Documents/Development/Avanlee Care/avanleeapp/AvanleeApp/AvanleeApp/App.xaml.cs", line 411, col 13, in async Task App.PopulateStartupTags(AttributeTagging tags) File "/Users/cmonson/Documents/Development/Avanlee Care/avanleeapp/AvanleeApp/AvanleeApp/App.xaml.cs", line 282, col 13, in async Task App.Takeoff(AttributeTagging tags) File "/Users/cmonson/Documents/Development/Avanlee Care/avanleeapp/AvanleeApp/AvanleeApp/App.xaml.cs", line 271, col 21, in async Task App.Initialize() File "/Users/cmonson/Documents/Development/Avanlee Care/avanleeapp/AvanleeApp/AvanleeApp/App.xaml.cs", line 480, col 13, in async void App.OnStart() File "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs", line 1021, col 49, in void AsyncMethodBuilderCore.ThrowAsync(Exception exception, SynchronizationContext targetContext)+(object state) => { } File "/Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs", line 178, col 5, in void NSAsyncSynchronizationContextDispatcher.Apply() File "/Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs", line 85, col 4, in void UIApplication.Main(string[] args, Type principalClass, Type delegateClass) File "/Users/cmonson/Documents/Development/Avanlee Care/avanleeapp/AvanleeApp/AvanleeApp.iOS/Main.cs", line 18, col 13, in void Application.Main(string[] args)

jkasten2 commented 1 year ago

@ChrisMonson Thanks for reporting this issue, we have found the cause and will be making an update soon.

This is a continuation of issue #314

ChrisMonson commented 1 year ago

Fantastic, thank you for the update!

jkasten2 commented 1 year ago

Tis is now included in the 4.1.2 release.