Open mskalash opened 1 year ago
Thanks for reporting
Could you provide your entire log with verbose logging?
You can add verbose logging by adding OneSignal.Default.LogLevel = LogLevel.Verbose;
before OneSignal.Default.Initialize(appId);
To narrow it the issue down, could you also call OneSignal.Default.Initialize
in your code only once?
I tested your steps in a new project and added OneSignal.Default.Initialize
and OneSignal.Default.PushSubscriptionStateChanged
to Start()
void Start()
{
OneSignal.Default.Initialize(appId);
OneSignal.Default.PushSubscriptionStateChanged += (current, previous) => {Debug.Log("Start User " + OneSignal.Default.PushSubscriptionState.userId); };
}
I noticed that in my Android Studio logcat, Debug.Log("Start User " + OneSignal.Default.PushSubscriptionState.userId)
shows up when I filter for “Unity” and not “OneSignal” - is this the case for you as well?
What happened?
after making the basic settings, the PushSubscriptionStateChanged method is called when the application is first launched, but does not pass the userid.
Steps to reproduce?
What did you expect to happen?
At the moment I have created a method that every 4 seconds calls the initialization of a new one and after 3 calls the system starts IEnumerator WaitOS() { yield return new WaitForSeconds(4); if (!notreload) { OneSignal.Default.Initialize(osconf.OneSignalKey); StartCoroutine(WaitOS()); } } example code how it works now
Unity version
2021.3.16 (latest)
OneSignal Unity SDK version
3.0.10
Platform
Android
Relevant log output
Code of Conduct