customerio / customerio-expo-plugin

MIT License
11 stars 9 forks source link

The `UIApplication.shared` error was received during the build phase when we activated Rich Push #39

Closed frknylmzcom2 closed 1 year ago

frknylmzcom2 commented 1 year ago

It started giving this error with the latest version coming to CocoaPods. So I can't get built in locally, and I can't continue development. I can't get builds from Expo either. Below I am sending you the details of the error. It doesn't get built as customerio-expo-plugin.ios.pushNotification.useRichPush: true on app.config. So there is no problem when useRichPush: false.

We are waiting impatiently. Thank You!

CC: @EArpaci

❌  (ios/Pods/CustomerIOCommon/Sources/Common/Util/UIKitWrapper.swift:19:23)

  17 |     public func open(url: URL) {
  18 |         #if canImport(UIKit)
> 19 |         UIApplication.shared.open(url: url)
     |                       ^ 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
  20 |         #endif
  21 |     }
  22 | 

❌  (ios/Pods/CustomerIOCommon/Sources/Common/Util/UIKitWrapper.swift:19:30)

  17 |     public func open(url: URL) {
  18 |         #if canImport(UIKit)
> 19 |         UIApplication.shared.open(url: url)
     |                              ^ 'open' is unavailable in application extensions for iOS
  20 |         #endif
  21 |     }
  22 | 

❌  (ios/Pods/CustomerIOCommon/Sources/Common/Util/UIKitWrapper.swift:32:50)

  30 |         openLinkInHostAppActivity.webpageURL = webpageURL
  31 | 
> 32 |         let didHostAppHandleLink = UIApplication.shared.delegate?.application?(UIApplication.shared, continue: openLinkInHostAppActivity, restorationHandler: { _ in }) ?? false
     |                                                  ^ 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
  33 | 
  34 |         return didHostAppHandleLink
  35 |         #else

❌  (ios/Pods/CustomerIOCommon/Sources/Common/Util/UIKitWrapper.swift:32:94)

  30 |         openLinkInHostAppActivity.webpageURL = webpageURL
  31 | 
> 32 |         let didHostAppHandleLink = UIApplication.shared.delegate?.application?(UIApplication.shared, continue: openLinkInHostAppActivity, restorationHandler: { _ in }) ?? false
     |                                                                                              ^ 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.
  33 | 
  34 |         return didHostAppHandleLink
  35 |         #else
frknylmzcom2 commented 1 year ago

Also, I can't get the Device ID with SDK.

frknylmzcom2 commented 1 year ago

The versions that Expo uses while building;

Creating new worker instance
Using VM template "macos-monterey-12.6-xcode-14.0" running macOS Monterey 12.6

Installed software:
- Xcode 14.0 (14A309)
- Node.js 16.18.1
- Yarn 1.22.17
- pnpm 7.11.0
- npm 8.1.2
- fastlane 2.210.0
- CocoaPods 1.11.3
- Ruby 2.7
- Expo CLI 6.0.0
xtreem88 commented 1 year ago

Hi @frknylmzcom2 Thanks for reaching out; we are aware of this issue and are working on a release to fix it. To unblock you, after running prebuild, try and apply this workaround and then run pod install in your ios folder. We apologize for the inconvenience and will release a fix for this issue soon.

frknylmzcom2 commented 1 year ago

Hi @xtreem88,

Thank you very much for your quick turnaround. This method is sufficient for development but still incorrect for the build.

What is your estimated time to resolve this error in general?

xtreem88 commented 1 year ago

@frknylmzcom2 I can't give a definite ETA on this, but I do know it is one of the high-priority bug fixes we are working on.