firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

In-App Messaging: `appData` property is nil in Draft Mode

Open DimDL opened this issue 2 years ago • 5 comments

Description

When previewing an InApp Campaign on Device as draft, appData is nil. Only when the campaign is publish, does appData become available. This was unexpected; we're using appData to provide additional UI options (we have a customize the rendering of InApp messages), so when previewing we need both the basic data (title, body…) as well as appData.

Reproducing the issue

STEPS :

  • Create a new in-app messaging on console.firebase.google.com
  • In Additional Options (aka custom Data aka appData), add a property, for ex: foo: bar
  • Test on device (aka, Save as Draft but don't publish)

RESULT : the campaign appears, but FIRInAppMessagingDisplayMessage.appData is nil EXPECTED : result: message.appData is not nil

Firebase SDK Version

10.2.0

Xcode Version

14.1

Installation Method

CocoaPods

Firebase Product(s)

Authentication, Crashlytics, In-App Messaging, Installations, Remote Config

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

  • Firebase/Analytics (9.6.0):
    • Firebase/Core
  • Firebase/Auth (9.6.0):
    • Firebase/CoreOnly
    • FirebaseAuth (~> 9.6.0)
  • Firebase/Core (9.6.0):
    • Firebase/CoreOnly
    • FirebaseAnalytics (~> 9.6.0)
  • Firebase/CoreOnly (9.6.0):
    • FirebaseCore (= 9.6.0)
  • Firebase/Crashlytics (9.6.0):
    • Firebase/CoreOnly
    • FirebaseCrashlytics (~> 9.6.0)
  • Firebase/Firestore (9.6.0):
    • Firebase/CoreOnly
    • FirebaseFirestore (~> 9.6.0)
  • Firebase/InAppMessaging (9.6.0):
    • Firebase/CoreOnly
    • FirebaseInAppMessaging (~> 9.6.0-beta)
  • Firebase/Messaging (9.6.0):
    • Firebase/CoreOnly
    • FirebaseMessaging (~> 9.6.0)
  • FirebaseABTesting (9.6.0):
    • FirebaseCore (~> 9.0)
  • FirebaseAnalytics (9.6.0):
    • FirebaseAnalytics/AdIdSupport (= 9.6.0)
    • FirebaseCore (~> 9.0)
    • FirebaseInstallations (~> 9.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    • GoogleUtilities/MethodSwizzler (~> 7.7)
    • GoogleUtilities/Network (~> 7.7)
    • "GoogleUtilities/NSData+zlib (~> 7.7)"
    • nanopb (< 2.30910.0, >= 2.30908.0)
  • FirebaseAnalytics/AdIdSupport (9.6.0):
    • FirebaseCore (~> 9.0)
    • FirebaseInstallations (~> 9.0)
    • GoogleAppMeasurement (= 9.6.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    • GoogleUtilities/MethodSwizzler (~> 7.7)
    • GoogleUtilities/Network (~> 7.7)
    • "GoogleUtilities/NSData+zlib (~> 7.7)"
    • nanopb (< 2.30910.0, >= 2.30908.0)
  • FirebaseAuth (9.6.0):
    • FirebaseCore (~> 9.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    • GoogleUtilities/Environment (~> 7.7)
    • GTMSessionFetcher/Core (< 3.0, >= 1.7)
  • FirebaseCore (9.6.0):
    • FirebaseCoreDiagnostics (~> 9.0)
    • FirebaseCoreInternal (~> 9.0)
    • GoogleUtilities/Environment (~> 7.7)
    • GoogleUtilities/Logger (~> 7.7)
  • FirebaseCoreDiagnostics (9.6.0):
    • GoogleDataTransport (< 10.0.0, >= 9.1.4)
    • GoogleUtilities/Environment (~> 7.7)
    • GoogleUtilities/Logger (~> 7.7)
    • nanopb (< 2.30910.0, >= 2.30908.0)
  • FirebaseCoreInternal (9.6.0):
    • "GoogleUtilities/NSData+zlib (~> 7.7)"
  • FirebaseCrashlytics (9.6.0):
    • FirebaseCore (~> 9.0)
    • FirebaseInstallations (~> 9.0)
    • GoogleDataTransport (< 10.0.0, >= 9.1.4)
    • GoogleUtilities/Environment (~> 7.7)
    • nanopb (< 2.30910.0, >= 2.30908.0)
    • PromisesObjC (~> 2.1)
  • FirebaseFirestore (9.6.0):
    • abseil/algorithm (~> 1.20211102.0)
    • abseil/base (~> 1.20211102.0)
    • abseil/container/flat_hash_map (~> 1.20211102.0)
    • abseil/memory (~> 1.20211102.0)
    • abseil/meta (~> 1.20211102.0)
    • abseil/strings/strings (~> 1.20211102.0)
    • abseil/time (~> 1.20211102.0)
    • abseil/types (~> 1.20211102.0)
    • FirebaseCore (~> 9.0)
    • "gRPC-C++ (~> 1.44.0)"
    • leveldb-library (~> 1.22)
    • nanopb (< 2.30910.0, >= 2.30908.0)
  • FirebaseInAppMessaging (9.6.0-beta):
    • FirebaseABTesting (~> 9.0)
    • FirebaseCore (~> 9.0)
    • FirebaseInstallations (~> 9.0)
    • GoogleUtilities/Environment (~> 7.7)
    • nanopb (< 2.30910.0, >= 2.30908.0)
  • FirebaseInstallations (9.6.0):
    • FirebaseCore (~> 9.0)
    • GoogleUtilities/Environment (~> 7.7)
    • GoogleUtilities/UserDefaults (~> 7.7)
    • PromisesObjC (~> 2.1)
  • FirebaseMessaging (9.6.0):
    • FirebaseCore (~> 9.0)
    • FirebaseInstallations (~> 9.0)
    • GoogleDataTransport (< 10.0.0, >= 9.1.4)
    • GoogleUtilities/AppDelegateSwizzler (~> 7.7)
    • GoogleUtilities/Environment (~> 7.7)
    • GoogleUtilities/Reachability (~> 7.7)
    • GoogleUtilities/UserDefaults (~> 7.7)
    • nanopb (< 2.30910.0, >= 2.30908.0)
  • FirebaseRemoteConfig (9.6.0):
    • FirebaseABTesting (~> 9.0)
    • FirebaseCore (~> 9.0)
    • FirebaseInstallations (~> 9.0)
    • GoogleUtilities/Environment (~> 7.7)
    • "GoogleUtilities/NSData+zlib (~> 7.7)"

DimDL avatar Nov 15 '22 10:11 DimDL

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Nov 15 '22 10:11 google-oss-bot

Thanks for reaching out, @DimDL. I tried to reproduce the issue but I was able to get the value of the appData. May I know if you have made any changes in your campaign in the console? Also, you may try our In-App Messaging Quickstart to isolate the issue and use this as your baseline for troubleshooting. Otherwise, we need a sample app that reproduces the issue to investigate.

rizafran avatar Nov 15 '22 19:11 rizafran

Hi @rizafran. I found the issue: When previewing as draft, appData is nil. Only when the campaign is publish, does appData become available. This was unexpected; we're using appData to provide additional UI options, so when previewing we need both the basic data (title, body…) as well as appData. Is there more info I can provide ?

DimDL avatar Nov 17 '22 18:11 DimDL

Retitled and reworded the description

DimDL avatar Nov 18 '22 10:11 DimDL

Thank you for clarifying your issue, @DimDL. I was able to reproduce it by using the "Test on device" button in the console, but on the second attempt of testing, the appData is showing. I'll inform the engineer about this and we'll let you know if it's a bug or intended behavior.

rizafran avatar Nov 18 '22 14:11 rizafran

This issue should be fixed now. It was a server fix so same SDK should work. I was able to verify that custom keys were returned for campaigns in Draft state when Testing on Device.

aashishpatil-g avatar Jan 10 '23 23:01 aashishpatil-g