@@ -554,26 +554,23 @@ public void run() {
554
554
* @param newAppId - String app id associated with the OneSignal dashboard app
555
555
*/
556
556
public static void setAppId (@ NonNull String newAppId ) {
557
- logger .verbose ("setAppId(id) called with app_id: " + newAppId + "!" );
558
-
559
557
if (newAppId == null || newAppId .isEmpty ()) {
560
- logger .warning ("newAppId is null or empty , ignoring!" );
558
+ logger .warning ("setAppId called with id: " + newAppId + " , ignoring!" );
561
559
return ;
562
560
} else if (!newAppId .equals (appId )) {
563
561
// Pre-check on app id to make sure init of SDK is performed properly
564
562
// Usually when the app id is changed during runtime so that SDK is reinitialized properly
565
563
initDone = false ;
564
+ logger .verbose ("setAppId called with id: " + newAppId + " changing id from: " + appId );
566
565
}
567
566
568
567
appId = newAppId ;
569
568
570
- logger .verbose ("setAppId(id) finished, checking if appContext has been set before proceeding..." );
571
569
if (appContext == null ) {
572
570
logger .warning ("appId set, but please call initWithContext(appContext) with Application context to complete OneSignal init!" );
573
571
return ;
574
572
}
575
573
576
- logger .verbose ("setAppId(id) successful and appContext is set, continuing OneSignal init..." );
577
574
init (appContext );
578
575
}
579
576
@@ -585,10 +582,8 @@ public static void setAppId(@NonNull String newAppId) {
585
582
* @param context - Context used by the Application of the app
586
583
*/
587
584
public static void initWithContext (@ NonNull Context context ) {
588
- logger .verbose ("initWithContext(context) called!" );
589
-
590
585
if (context == null ) {
591
- Log ( LOG_LEVEL . WARN , "context is null, ignoring!" );
586
+ logger . warning ( "initWithContext called with null context , ignoring!" );
592
587
return ;
593
588
}
594
589
@@ -597,19 +592,19 @@ public static void initWithContext(@NonNull Context context) {
597
592
setupActivityLifecycleListener (wasAppContextNull );
598
593
setupPrivacyConsent (appContext );
599
594
600
- logger .verbose ("initWithContext(context) finished, checking if appId has been set before proceeding..." );
601
595
if (appId == null ) {
602
596
// Get the cached app id, if it exists
603
597
String oldAppId = getSavedAppId ();
604
598
if (oldAppId == null ) {
605
599
logger .warning ("appContext set, but please call setAppId(appId) with a valid appId to complete OneSignal init!" );
606
600
} else {
607
- logger .verbose ("appContext set and an old appId was found, attempting to call setAppId(oldAppId)" );
601
+ logger .verbose ("appContext set and cached app id found, calling setAppId with: " + oldAppId );
608
602
setAppId (oldAppId );
609
603
}
610
604
return ;
605
+ } else {
606
+ logger .verbose ("initWithContext called with: " + context );
611
607
}
612
- logger .verbose ("initWithContext(context) successful and appId is set, continuing OneSignal init..." );
613
608
init (context );
614
609
}
615
610
@@ -637,6 +632,7 @@ public static void setInAppMessageClickHandler(@Nullable OSInAppMessageClickHand
637
632
* Called after setAppId and initWithContext, depending on which one is called last (order does not matter)
638
633
*/
639
634
synchronized private static void init (Context context ) {
635
+ logger .verbose ("Starting OneSignal initialization!" );
640
636
OSNotificationController .setupNotificationServiceExtension (appContext );
641
637
642
638
if (requiresUserPrivacyConsent () || !remoteParamController .isRemoteParamsCallDone ()) {
0 commit comments