Skip to content

Conversation

@adamschlesinger
Copy link
Contributor

@adamschlesinger adamschlesinger commented Jan 19, 2022

Fixed

  • Will no longer init SDK again if done before RuntimeInitializeOnLoadMethod

This change is Reviewable

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @adamschlesinger, @iAmWillShepherd, and @shepherd-l)


com.onesignal.unity.android/Runtime/OneSignalAndroidInit.cs, line 37 at r1 (raw file):

    internal static class OneSignalAndroidInit {
        [RuntimeInitializeOnLoadMethod] public static void Init() {
            if (string.IsNullOrEmpty(OneSignal.AppId))

Why check if the AppId is null or empty instead of checking if OneSignal.Default is not null?


com.onesignal.unity.ios/Runtime/OneSignalIOSInit.cs, line 37 at r1 (raw file):

    internal static class OneSignalIOSInit {
        [RuntimeInitializeOnLoadMethod] public static void Init() {
            if (string.IsNullOrEmpty(OneSignal.AppId))

Why check if the AppId is null or empty instead of checking if OneSignal.Default is not null?

Copy link
Contributor Author

@adamschlesinger adamschlesinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @iAmWillShepherd, @jkasten2, and @shepherd-l)


com.onesignal.unity.android/Runtime/OneSignalAndroidInit.cs, line 37 at r1 (raw file):

Previously, jkasten2 (Josh Kasten) wrote…

Why check if the AppId is null or empty instead of checking if OneSignal.Default is not null?

That's primarily a result of the get/set methods inside Default. Realistically I could also simply remove both of these classes entirely which would also fix the issue. These are simply small optimizations.


com.onesignal.unity.ios/Runtime/OneSignalIOSInit.cs, line 37 at r1 (raw file):

Previously, jkasten2 (Josh Kasten) wrote…

Why check if the AppId is null or empty instead of checking if OneSignal.Default is not null?

Ditto as above.

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @iAmWillShepherd and @shepherd-l)

@adamschlesinger adamschlesinger merged commit ec3321d into develop Jan 19, 2022
@adamschlesinger adamschlesinger deleted the fix/doubledInit branch January 19, 2022 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants