appcues / appcues-expo-module

The Appcues Expo Module
MIT License
1 stars 0 forks source link

Option to use "appcues-ios-sdk" within "@appcues/expo-config" as a static library. #16

Open wiktor7245 opened 18 hours ago

wiktor7245 commented 18 hours ago

Hi, i wanted to use your library on expo app which has "@react-native-firebase" libraries to handle notifications. When i want to prebuild and launch the app i get:

[!] Unable to integrate the following embedded targets with their respective host targets (a host target is a "parent" target which embeds a "child" target like a framework or extension):

 ExpoApp (true) and AppcuesNotificationServiceExtension (false) do not both set use_frameworks!.

I can resolve that by manually patch the library using patch-package, but i don't want to have that solution forever. So, can you add option to use appcues-ios-sdk as a static library. And, this is my current fix:

};
exports.PODFILE_SNIPPET = `
target '${exports.APPCUES_NSE_TARGET.NAME}' do
  use_frameworks!:linkage => :static
  pod '${exports.APPCUES_NSE_TARGET.POD_NAME}', '4.0.0'
end
`;
exports.DEFAULT_BUNDLE_VERSION = '1';
mmaatttt commented 12 hours ago

Hi @wiktor7245,

Can you confirm you're using expo-build-properties as part of the @react-native-firebase Expo configuration instructions like this:

{
  "expo": {
    ..
    "plugins": [
      ..
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]
  }
}

I'm assuming you are, which means we can do this instead of hardcoding to :static:

export const PODFILE_SNIPPET = `
target '${APPCUES_NSE_TARGET.NAME}' do
  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  pod '${APPCUES_NSE_TARGET.POD_NAME}', '4.0.0'
end
`;

I'll open a PR with this change, but wait to merge it until you confirm this approach will work for you.