Leanplum / Leanplum-iOS-SDK

Leanplum's integrated solution delivers meaningful engagement across messaging and the in-app experience.
https://www.leanplum.com
Apache License 2.0
71 stars 59 forks source link

Storyboard error when launching a rich interstitial #567

Closed alessiolapenna closed 11 months ago

alessiolapenna commented 11 months ago

Expected Behavior

The rich insterstitial is shown correctly

Actual Behavior

Nothing is shown and and error is logged by the sdk

Steps to Reproduce the Problem

  1. Create a rich interstitial
  2. Trigger the event for the show in the app

Specifications

This is the log that the console debugger shows: [LEANPLUM] [ERROR]: Error in message template HTML: Could not find a storyboard named 'WebInterstitial' in bundle LokaliseNSBundle </private/var/containers/Bundle/Application/5A264370-A921-43DF-B7E2-52279E8CE01E/PrintUP.app> (loaded) ( 0 CoreFoundation 0x000000019a6c8cc0 4230C122-42E8-383B-BEEC-EE7B61F8BB61 + 40128 1 libobjc.A.dylib 0x00000001937703d0 objc_exception_throw + 60 2 UIKitCore 0x000000019cb37a5c B3834960-244B-34E4-9EA0-CA4BB44EF0F3 + 4233820 3 PrintUP 0x0000000105728854 +[LPWebInterstitialViewController instantiateFromStoryboard] + 64 4 PrintUP 0x00000001057207b8 -[LPRichInterstitialMessageTemplate viewControllerWithContext:] + 36 5 PrintUP 0x0000000105720674 __49+[LPRichInterstitialMessageTemplate defineAction]_block_invoke + 80 6 PrintUP 0x000000010575c1c0 $sSo15LPActionContextC10ObjectiveC8ObjCBoolVIeyByd_ABSbIeggd_TRTA + 24 7 PrintUP 0x0000000105758eb0 $s8Leanplum13ActionManagerC14performActionsyyF + 2156 8 PrintUP 0x0000000105759190 $s8Leanplum13ActionManagerC14performActionsyyFTo + 28 9 PrintUP 0x0000000100bdf194 $sIeg_IeyB_TR + 48 10 libdispatch.dylib 0x000000011ae6c520 _dispatch_call_block_and_release + 32 11 libdispatch.dylib 0x000000011ae6e038 _dispatch_client_callout + 20 12 libdispatch.dylib 0x000000011ae7e798 _dispatch_main_queue_drain + 1196 13 libdispatch.dylib 0x000000011ae7e2dc _dispatch_main_queue_callback_4CF + 44 14 CoreFoundation 0x000000019a757c28 4230C122-42E8-383B-BEEC-EE7B61F8BB61 + 625704 15 CoreFoundation 0x000000019a739560 4230C122-42E8-383B-BEEC-EE7B61F8BB61 + 501088 16 CoreFoundation 0x000000019a73e3ec CFRunLoopRunSpecific + 612 17 GraphicsServices 0x00000001d5c0335c GSEventRunModal + 164 18 UIKitCore 0x000000019cacb6e8 B3834960-244B-34E4-9EA0-CA4BB44EF0F3 + 3790568 19 UIKitCore 0x000000019cacb34c UIApplicationMain + 340 20 PrintUP 0x0000000100c19bd8 main + 656 21 dyld 0x00000001b9c3edec 8A423F3F-B318-315E-99C7-05EE532E9C0D + 89580 )

nzagorchev commented 11 months ago

Hi @alessiolapenna I guess you are using SPM, you need to follow the steps here: https://docs.leanplum.com/reference/ios-setup#b-install-through-swift-package-manager and specifically: Add the following script to the app Build Phases -> New Run Script Phase:

cp -R -L ${BUILT_PRODUCTS_DIR}/Leanplum.framework/*.bundle ${BUILT_PRODUCTS_DIR}/${TARGET_NAME}.app 

The script ensures that the Leanplum Resources bundle is available in the app.

alessiolapenna commented 11 months ago

Thank you. this solved my problem.

galipMNL commented 9 months ago

Embedding resources within a Swift Package is supported since SPM 5.3. Will you be supporting this some time soon?