adobe / aepsdk-react-native

A wrapper around the iOS and Android AEP mobile SDK to allow for integration with React Native applications.
Apache License 2.0
15 stars 29 forks source link

iOS build errors in AEPServices-Swift.h #361

Closed wellD-MOrlandi closed 5 months ago

wellD-MOrlandi commented 5 months ago

Prerequisites

Bug summary

Description: Encountering multiple build errors while building an app that uses the following Adobe React Native SDKs:

Environment

OS: macOS 15.5 XCode: 15.4 React: 18.2.0 React Native: 0.74.1

Steps to reproduce

Build the app

Current behavior

Build Errors:

  1. Error in AEPServices-Swift.h at line 480:

    @interface AEPFullscreenMessage (SWIFT_EXTENSION(AEPServices)) <WKScriptMessageHandler>
    ^ cannot find protocol declaration for 'WKScriptMessageHandler'
  2. Error in AEPServices-Swift.h at line 489:

    @interface AEPFullscreenMessage (SWIFT_EXTENSION(AEPServices)) <WKNavigationDelegate>
    ^ cannot find protocol declaration for 'WKNavigationDelegate'; did you mean 'UINavigationBarDelegate'?
  3. Error in AEPServices-Swift.h at line 490:

    ...vigationAction:(WKNavigationAction * _Nonnull)navigationAction decisionHandler:(void (^ _Nonnull)(WKNavigationActionPolicy))decisionHandler;
    ^ unknown type name 'WKNavigationActionPolicy'; did you mean 'WKNavigationAction'?
  4. Error in AEPServices-Swift.h at line 490:

    ...tionAction * _Nonnull)navigationAction decisionHandler:(void (^ _Nonnull)(WKNavigationActionPolicy))decisionHandler;
    ^ interface type 'WKNavigationAction' cannot be passed by value; did you forget * in 'WKNavigationAction'?

Expected behavior

The build should succed

Anything else?

I tryed updating all 4 adobe libs we are using to the latest version but the output doesn't change

wellD-MOrlandi commented 5 months ago

I found a solution to the issue by adding the following import statement to the AppDelegate:

#import <WebKit/WebKit.h>