customerio / customerio-expo-plugin

MIT License
11 stars 9 forks source link

TypeError: Cannot read properties of undefined (reading 'toUpperCase') #135

Closed dannyhw closed 7 months ago

dannyhw commented 7 months ago

After updating to expo 50 and xcode 15.3 and the customerio packages I started getting a few different errors

"customerio-expo-plugin": "^1.0.0-beta.15",
"customerio-reactnative": "^3.5.3",

I get this one during prebuild

TypeError: Cannot read properties of undefined (reading 'toUpperCase')
    at updatePushFile (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js:254:131)
    at addPushNotificationFile (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js:235:3)
    at addNotificationServiceExtension (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js:19:13)
    at /Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/customerio-expo-plugin/lib/commonjs/ios/withNotificationsXcodeProject.js:75:39
    at action (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/@expo/config-plugins/build/plugins/withMod.js:201:29)
    at interceptingMod (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/@expo/config-plugins/build/plugins/withMod.js:105:27)
    at action (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/@expo/config-plugins/build/plugins/withMod.js:206:14)
    at async interceptingMod (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/@expo/config-plugins/build/plugins/withMod.js:105:21)
    at async interceptingMod (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/@expo/config-plugins/build/plugins/withMod.js:105:21)
    at async interceptingMod (/Users/danielwilliams/Workspace/arro/arro-frontend/node_modules/@expo/config-plugins/build/plugins/withMod.js:105:21)

then in the build for ios I get this

❌  (ios/ArroStaging/AppDelegate.mm:21:1)

  19 | 
  20 | 
> 21 | CIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];
     | ^ unknown type name 'CIOAppPushNotificationsHandler'
  22 | 
  23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  24 | {

❌  (ios/ArroStaging/AppDelegate.mm:21:50)

  19 | 
  20 | 
> 21 | CIOAppPushNotificationsHandler* pnHandlerObj = [[CIOAppPushNotificationsHandler alloc] init];
     |                                                  ^ use of undeclared identifier 'CIOAppPushNotificationsHandler'
  22 | 
  23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  24 | {
dannyhw commented 7 months ago

Turns out I needed to add region to my env in the plugin config, weird that this didn't break before 😅