@@ -18,6 +18,18 @@ const RESOLVED_APP_ID = APP_ID?.trim() || DEFAULT_APP_ID;
1818const apiService = OneSignalApiService . getInstance ( ) ;
1919const preferences = PreferencesService . getInstance ( ) ;
2020
21+ // uncomment to debug ios logs in safari web inspector
22+ // const buf: string[] = [];
23+ // (['log', 'warn', 'error'] as const).forEach((level) => {
24+ // const orig = console[level].bind(console);
25+ // console[level] = (...args) => {
26+ // buf.push(`[${level}] ${args.map(String).join(' ')}`);
27+ // localStorage.setItem('__logs', JSON.stringify(buf.slice(-500)));
28+ // orig(...args);
29+ // };
30+ // });
31+ // then later call JSON.parse(localStorage.getItem('__logs')).forEach(l => console.log(l))
32+
2133// One-shot SDK initialization at module-eval time. Capacitor's bridge queues
2234// calls until native is ready, so no `deviceready` gating is required. The
2335// downstream `OneSignal.initialize` short-circuits on the native side, but
@@ -261,11 +273,6 @@ export function useOneSignal(): UseOneSignalReturn {
261273 OneSignal . User . addEventListener ( 'change' , userChangeHandler ) ;
262274
263275 const load = async ( ) => {
264- // Uncomment if you want so you have time to see logs while trying to open
265- // safari web inspector. Not an issue for chrome web inspector.
266- // await new Promise((resolve) => setTimeout(resolve, 10_000));
267- // if (cancelled) return;
268-
269276 const [ externalId , pushId , pushOptedIn , hasPerm , initialOnesignalId ] = await Promise . all ( [
270277 OneSignal . User . getExternalId ( ) ,
271278 OneSignal . User . pushSubscription . getIdAsync ( ) ,
0 commit comments