Open G-r-i-n-c-h opened 3 months ago
Thanks for sharing!
What version of the OneSignal Unity SDK and Unity Editor are you using?
Are you able to reproduce this error? And could you provide the steps to do so
Can you provide your entire log with verbose logging turned on by calling OneSignal.Debug.LogLevel = LogLevel.Verbose
before initializing
So, Problem is that i am getting this really random. In my solution different user can login and logout.
Unity 2022.3.22f, Onesignal 5.1.1.
Where are you calling OneSignal.Logout()
? Could you provide steps to what you are doing in your code?
Are you calling OneSignal.Logout()
before OneSignal.Initialize(appId)
? OneSignal.Initialize(appId)
should be called first on app startup because it initializes the OneSignal SDK.
When user logs in with his account i am calling OneSignal.Initialize(AppID); Then waiting for user response to set external user id with this OneSignal.Login(CurrentUserData.id); After that user can log out any time and log in again same flow is applied.
Can a user be logged out without calling OneSignal.Initialize(appId)
on a new cold start?
OneSignal.Initialize
needs to be called on every new cold start of the application before any methods should be used.
Got it. that was a case i was calling only once init and then only user login/logout. Will continue checking if all good will update here.
How can we help?
Hey, Got some problem Calling logout and reciving something like that
Must call 'initWithContext' before 'logout' java.lang.Exception: Must call 'initWithContext' before 'logout' at com.onesignal.internal.OneSignalImp.logout(OneSignalImp.kt:423) at com.onesignal.OneSignal.logout(OneSignal.kt:193) at com.unity3d.player.UnityPlayer.nativeRender(Native Method) at com.unity3d.player.UnityPlayer.-$$Nest$mnativeRender(Unknown Source:0) at com.unity3d.player.UnityPlayer$F$a.handleMessage(Unknown Source:122) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at com.unity3d.player.UnityPlayer$F.run(Unknown Source:24) at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.AndroidJavaObject._CallStatic (System.IntPtr methodID, System.Object[] args) [0x00000] in <00000000000000000000000000000000>:0
does anyone have the same problem ?
Code of Conduct