You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract protected-data setup into +setupProtectedDataObserverOnce
and ComputeInitialStorageReadable, called from +init. Owns the
atomic-BOOL latch, DidBecomeAvailable observer (CAS-gated so it
runs at most once per process), provider closure, and seed.
Gate startLiveActivitiesManager / startInAppMessages on the
predicate so their singletons don't load empty UD state during
prewarm; observer re-drives them post-unlock.
Switch startNewSessionInternal to the full predicate so it defers
during prewarm.
handleAppIdChange: nil-guard prevAppId; extend clear set with
OSUD_RECEIVE_RECEIPTS_ENABLED, the push-sub model store UD entry,
and three OSResilientStorage keys; mirror app_id on every setAppId.
downloadIOSParamsWithAppId mirrors receive_receipts to
OSResilientStorage for the NSE fallback.
Called after setAppId and setLaunchOptions, depending on which one is called last (order does not matter)
456
526
*/
457
527
+ (void)init {
458
528
[OneSignalLog onesignalLog:ONE_S_LL_VERBOSEmessage:[NSStringstringWithFormat:@"launchOptions is set and appId of %@ is set, initializing OneSignal...", OneSignalIdentifiers.currentAppId]];
459
-
529
+
530
+
[selfsetupProtectedDataObserverOnce];
531
+
460
532
// TODO: We moved this check to the top of this method, we should test this.
461
533
if (initDone) {
462
534
return;
@@ -505,8 +577,12 @@ + (void)init {
505
577
[selfstartLifecycleObserver];
506
578
//TODO: Should these be started in Dependency order? e.g. IAM depends on User Manager shared instance
507
579
[selfstartUserManager]; // By here, app_id exists, and consent is granted.
508
-
[selfstartLiveActivitiesManager];
509
-
[selfstartInAppMessages];
580
+
// Defer LA and IAM init during prewarm: both eagerly read UserDefaults at first access and would
581
+
// overwrite the on-disk state with empty caches on the next save. The observer re-drives them post-unlock.
582
+
if (![OneSignalConfig shouldAwaitAppIdAndLogMissingPrivacyConsentForMethod:nil]) {
0 commit comments