OneSignal-Unity-SDK
OneSignal-Unity-SDK copied to clipboard
[General]: UnityMainThreadDispatch uses [RuntimeInitializeOnLoadMethod]
What's on your mind?
In OneSignal started from version 3 UnityMainThreadDispatch uses when we call OneSignal.Default.GetTags() in Android platform. The problem is that context getting with [RuntimeInitializeOnLoadMethod] attribute. According to Unity documentation [RuntimeInitializeOnLoadMethod] methods are executed after Awake() event. If we initialize OneSignal in awake and then trying to GetTags we instantly get an exception.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Thanks for the feedback, what you said is correct. We recommend that you initialize OneSignal in the Start() method. Is this an option for you? If not, could you help us understand why you want to initialize OneSignal in Awake()?