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
105 stars 50 forks source link

[Bug]: RemoveExternalUserId/SetExternalUserId no answer #341

Open twelve-cgn opened 2 years ago

twelve-cgn commented 2 years ago

What happened?

I am currently trying to upgrade from 3.10.6 to 4.1.3. So far we have always called:

Com.OneSignal.OneSignal.Current.SetExternalUserId(Application.User.PushUserId);
Com.OneSignal.OneSignal.Current.DeleteTags(new List<string>() { "pushuserid", "Database", "Version"});
Com.OneSignal.OneSignal.Current.SendTags(new Dictionary<string, string>()
                  {
                      { "pushuserid", Application.User.PushUserId },
                      { "Database", Application.User.Database },
                      { "License", Application.User.Licensename },
                      { "Version", Xamarin.Essentials.AppInfo.VersionString }
                  });

We have never used a RemoveExternalUserId before.

If I now simply call a SetExternalUserId, I no longer get a response if another userid was previously set. With RemoveExternalUserId I get no response if no UserId was set so far.

removed = await OneSignalSDK.Xamarin.OneSignal.Default.RemoveExternalUserId();
set = await OneSignalSDK.Xamarin.OneSignal.Default.SetExternalUserId(Application.User.PushUserId);

I have already adjusted the handling of the tags, so that only changed/added tags are set. But also here the SendTags does not work, but I have to send each tag individually by SendTag.

I really despair. So far, the connection never made problems, but with the 4 version really nothing works.

Is there perhaps a simple example application, with the current target versions (Android API 31 / iOS 15.4+)

Steps to reproduce?

Install 4.1.3

What did you expect to happen?

That it works like the old version

OneSignal Xamarin SDK version

4.1.3

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct

robfrancis commented 1 year ago

Are you still having this issue? Did you find a work around?

I am also seeing this issue.

var result = await OneSignal.Default.RemoveExternalUserId();

Appears to never return a result if the ExternalUserId does not exist/has previously been removed. Using version 4.3.4

emawby commented 1 year ago

@robfrancis Thank you for reporting are you also not receiving a response if you set a second setExternalUserId? We will investigate and work on a fix for both problems

robfrancis commented 1 year ago

@robfrancis Thank you for reporting are you also not receiving a response if you set a second setExternalUserId? We will investigate and work on a fix for both problems

I have found this issue only affect Android.

Provided an ExternalUserId exists prior to this next segment of code

var result = await OneSignal.Default.RemoveExternalUserId();
Debug.WriteLine($"RemoveExternalUserId() 1 - {result}");

var result2 = await OneSignal.Default.RemoveExternalUserId();
Debug.WriteLine($"RemoveExternalUserId() 2 - {result2}");

result returns correctly. result2 never returns and hangs on this line. The debug line below it does not execute and no exception is thrown.

robfrancis commented 1 year ago

@emawby

Any update on this?

Cvijo commented 1 year ago

Same problem in my case too. SetExternalUserId hangs application