SDK 34 host.exp.exponent.EXUserNotificationCenter is crashing for iOS standalone app

After building ipa and installing the app for the first time (on iPhone), it will ask for notifications permissions. No matter what will you chose, the app will crash.

Here is the log:

Thread 12 name: Dispatch queue: host.exp.exponent.EXUserNotificationCenter
Thread 12 Crashed:
0 libdispatch.dylib 0x00000001ef00e5d4 0x1ef008000 + 26068
1 libdispatch.dylib 0x00000001ef00e56c 0x1ef008000 + 25964
2 CsgoComBidApp 0x0000000100fdebfc 0x100e68000 + 1534972
3 libdispatch.dylib 0x00000001ef067a38 0x1ef008000 + 391736
4 libdispatch.dylib 0x00000001ef0687d4 0x1ef008000 + 395220
5 libdispatch.dylib 0x00000001ef011324 0x1ef008000 + 37668
6 libdispatch.dylib 0x00000001ef011e40 0x1ef008000 + 40512
7 libdispatch.dylib 0x00000001ef01a4ac 0x1ef008000 + 74924
8 libsystem_pthread.dylib 0x00000001ef249114 0x1ef23d000 + 49428
9 libsystem_pthread.dylib 0x00000001ef24bcd4 0x1ef23d000 + 60628

Hey @gradientbv,

Can you share the complete code that is causing the crash?

Cheers,
Adam

Well it feels like I forgot to make expo install expo-permissions.
@adamjnav, should I rebuild the bundle (.apk and .ipa) now?

Ok. I’ve made expo install expo-permissions, rebuild .ipa, but the app continues to crash. Here is my code, maybe there is an error in it.

import { Notifications } from 'expo';
import * as Permissions from 'expo-permissions';

async function registerForPushNotificationsAsync() {
  const { status } = await Permissions.getAsync(Permissions.NOTIFICATIONS);

  if (status !== 'granted') {
    const askRes = await Permissions.askAsync(Permissions.NOTIFICATIONS);

    if (!askRes || askRes.status !== 'granted') {
      return Promise.resolve('Notoken');
    }
  }

  const res = Promise.race([
    new Promise((resolve) => {
      setTimeout(resolve, 4000, 'Notoken');
    }),
    new Promise((resolve) => {
      const t = async () => await Notifications.getExpoPushTokenAsync();
      t().then((value) => resolve(value));
    }),
  ])

  return res;
}