Commit Graph
54 Commits
Author SHA1 Message Date
alien190 56535837c4 Fix for issue #8907 InApp message is shown every new session (#8922)
* Fix for issue #8907 InApp message is shown every new session (timestamp of the impression record is always 0 seconds).
2021-12-03 12:59:36 -08:00
Paul Beusterien c7c0149351 Update to clang-format@13 (#8739) 2021-10-04 07:52:21 -07:00
Yakov Manshin d28849cb12 [#8485] Added URL Recovery for IAM URLs (#8486)
* URL strings in in-app messages are sanitized and, when possible, recovered before they’re used in the `NSURL` initializer
* Added validation for image URLs, which must use the HTTPS scheme, according to the Firebase Console
* Updated `FIRIAMFetchResponseParserTests` to test URL validation and recovery
2021-08-11 06:37:32 -07:00
Yakov Manshin 33ce2c2da4 [#8482] Fixed Crash Caused by Invalid IAM Image URL (#8483)
* Fixed a bug where an invalid image URL string in an in-app message crashed the client app
* A URL string is considered invalid if the `[NSURL URLWithString:]` method produces `nil`
2021-08-09 11:51:30 -07:00
Morgan Chen 6a817139d3 Update FIAM to use NS_UNAVAILABLE (#8480)
* Update fiam to use ns_unavailable

* add pr number

* Add missing doc comment

* fix test
2021-08-03 08:42:33 -07:00
Paul Beusterien d287788cf7 Fix tvOS SPM tests (#8403) 2021-07-20 09:11:24 -07:00
Paul Beusterien c0df01d5f0 Fix Xcode 13 beta 3 build issues (#8405) 2021-07-19 07:18:36 -07:00
christibbs 6e3f659207 Add support for testing in-app messages in SwiftUI previews (#8351)
* Expose most of the initializers for message metadata classes for use in unit testing or SwiftUI previews

* Fix import in FIRIAMFetchFlowTests

* Simplify UI test app to use now public initializers (doesn't build)

* Update public header to use stripped down message initializers that only include parameters that effect layout

* Fix nullability for body text in in-app message initializers, add helper methods for generating mock messages

* Remove default image for image-only convenience initializer

* Make initializers non optional, document force unwraps

* Finalize helper methods, update test project to use the preview helpers

* Update UI tests to use new initializers

* Revert Cocoapods related project changes

* Add copyright notices to new files

* Change target version of DefaultUI test app back to 10.0

* Add unit tests for

* Fix color that wasn't available on tvOS

* Udpdate CHANGELOG

* Update UI test app to 13.2 to avoid [DVTiPhoneSimulator -primaryInstrumentsServer was called from the main thread

* Update to target 13.2

* Revert "Update to target 13.2"

This reverts commit 8189b64b68.

* Revert "Update UI test app to 13.2 to avoid [DVTiPhoneSimulator -primaryInstrumentsServer was called from the main thread"

This reverts commit 2371ff2a84.

* Remove unnecessary ABTExperimentPayload import. Fix nullability of ABTExperimentPayload param in initializers

* Revert iOS target in project.pbxproj file

* Revert removals of references to GoogleService-Info.plist

* Let Xcode handle spacing in project file
2021-07-16 16:04:14 -04:00
Paul Beusterien 0d90f2f12d Update to clang-format 12.0.1 (#8397) 2021-07-16 11:40:42 -07:00
Fumito Ito 5e787f2fac Fix lack of parse for fiam modal action button (#8140)
* fix lack of parse for modal action button

* add test for modal button text color
2021-06-07 12:28:09 -04:00
christibbs 62c71f98d7 Fix setting of in-app message type in FIRInAppMessagingImageOnlyDisplay initializer (#8118)
* Fix message type in ImageOnlyMessage initializer

* Update CHANGELOG
2021-05-19 11:53:29 -07:00
Nick Cooke a05ce1cf0a Reorganize FIAM's Resources for FIAM (#7788) 2021-04-06 17:09:54 -04:00
Yakov Manshin aa05e91a10 [#7791] Removed Duplicate Code in IAM (#7792)
* Removed `FIRIAMRenderingWindowHelper`’s `UIWindowForImageOnlyView` method whose body was identical to `UIWindowForModalView`’s
* Renamed `UIWindowForModalView` to `windowForBlockingView` and `UIWindowForBannerView` to `windowForNonBlockingView`, respectively, to clarify their purpose
2021-03-29 12:56:26 -04:00
christibbs e22c7a7b44 Display custom FIAMs with SwiftUI (#7496)
* Revert to previous nil check on experiment JSON

* Add Swift extensions podspec

* Add viewmodifier for displaying custom in-app messages w/ SwiftUI

* Add Multiplatform project to integration test SwiftUI pod

* We don't support macOS yet, comment that out from the Podfile

* Fix variable renaming bug

* View modifier implementation that works, but design is questionable

* Super basic integration

* Split view modifiers based on in-app message subtype

* Fix versioning in podspec

* Configure Firebase in test app

* Remove trailing whitespace

* Clean up SDK fetching code, sample app

* Updates to sample code, fully functional modal message now

* Update implementing app example

* Better code readability for view modifiers

* Add unit tests for DelegateBridge

* Add test target to pod spec

* Add copyright notices

* Remove whitespace from pod spec

* Add auto-complete documentation for in-app message extensions

* Lowered min target

* Update Package.swift

* First pass at CI updates

* @available(13) for SwiftUI structs

* Use singleton DelegateBridge

* Update inappmessaging.yml

* Run scripts/style.sh

* Update build.sh

* Modify build.sh

* Update CHANGELOG, try something new with GHA configuration

* Let's try this for GHA

* Fully qualify FIAM message enums

* Remove redundant type declaration

* Let's try direct instantiation of messages in unit tests

* Test CI build works without actual test cases

* Let's try this, making init available.

* Try exposing initializer

* Expose simpler initializer for in-app message superclass

* Fix up UI test app initializers

* Update CHANGELOG, GHA workflows

* Cleaner GHA test flow

* Clean up custom in-app message view modifier implementation

* Configuration cleanup

* Add some tests to ensure FIAM SwiftUI API compiles

* Add SpecsDev to Podfile of integration testing app. Make @State var private
2021-03-16 19:40:03 -04:00
christibbs f6d3a8c614 Better VoiceOver experience for in-app messages (#7445)
* Better accessibility labels for FIAM images and close buttons

* At FIAM display time, announce that the message has appeared in VoiceOver mode

* In VoiceOver mode, announce the close button last. This is a better accessibility experience for finding the close button.

* For modal messages, include the action button in accessibility elements. Exclude the image view if there's no image.

* Update CHANGELOG

* Include campaign name in accessibility label for images

* Fix failing modal message UI tests
2021-02-04 17:03:44 -05:00
christibbs 30e6caef1a Track conversions on in-app message campaigns without a clickthrough URL (#7306)
* Start tracking conversions on in-app message campaigns that don't have an action URL. Do this at impression time. (Initial implementation commit)

* Add test coverage, use FIRIAMMessageDefinition in implementation for cleaner code all-around

* Add CHANGELOG

* Update CHANGELOG
2021-02-04 15:47:17 -05:00
Yakov Manshin 81138ebb4b [#7309] Fixed messageDisplaySuppressed Ignored on Slow Networks (#7313)
* Added suppressMessageDisplay Check Before Message Display

* Updated FIRIAMDisplayExecutorTests

* Updated Format with style.sh

* Added Logging for Early Return in FIRIAMDisplayExecutor
2021-02-02 11:29:23 -05:00
christibbs 7cca96207d Fix FIAM test on device crash (#7328)
* Revert to previous nil check on experiment JSON

* Remove assert in FIRIAMDisplayExecutor

* Update CHANGELOG

* Change nullability of imageData in displayMessageWithDefinition:

* Keep nullability with card initializers, put nil message return back if imageData is nil

* Revert back to explicit non-null

* Actually shouldn't be nonnull due to other message types w/ optional imageData 😅
2021-01-20 18:13:15 -05:00
Paul Beusterien 1e9deea6cf Make FIAM tvOS minimum version consistent with Firebase (#7263) 2021-01-07 09:29:57 -08:00
christibbs b41a127336 Support in-app messaging on tvOS apps (#7160)
* Unlock tvOS for in-app messaging. Podspec needs refactoring

* Remove trailing whitespace

* Remove trailing whitespace

* Fix whitespace

* Add tvOS tests to GHA

* Add TARGET_OS_TV to endifs. Get rid of another pre iOS10 URL open check

* Fix yml for GHA

* Don't build default UI sample app on tvOS

* Better logging for nil message display component in tvOS

* Silence archiving deprecation warnings

* Lower tvOS support target
2020-12-17 18:53:19 -05:00
christibbs 6e1ba33a56 Use initWithFrame: to create the in-app message window in non-UIScene apps (#7080)
* If the app doesn't have a scene delegate, use initWithFrame: to create the in-app message window

* Refactor window creation method for iOS 13 and above

* Add CHANGELOG entry

* Fix CHANGELOG entry
2020-12-03 15:31:45 -05:00
Jim Hays fad62c0448 Change instances of 'dimiss' to 'dismiss' (#6708) 2020-10-12 12:47:19 -04:00
Paul Beusterien 672256e11e C API for Firebase Version (#6690) 2020-10-07 15:03:20 -07:00
Paul Beusterien 83e898ab5c One Firebase version (#6634) 2020-10-02 12:26:22 -07:00
christibbs 00a3021c47 Remove deprecated elements of FIAM API (#6617)
* Remove deprecated FIAM API

* Remove call to deprecated method

* Fix imports

* Modify view controllers to use dummy test subclasses for message objects

* Add bridging header, include it in test app

* Add CHANGELOG entry

* Revert "Add CHANGELOG entry"

This reverts commit 55c0bbcff5.

* Add CHANGELOG entry

* Swift formatting

* Add LLC to copyright notice

* Revert "Fix imports"

This reverts commit 55fdbbd3e0.
2020-10-01 16:00:57 -04:00
Paul Beusterien f2bcd5d82b Make all GoogleUtilities APIs public (#6588) 2020-09-29 07:26:10 -07:00
Paul Beusterien 3ca4e99c0e Stop requiring pods to be static frameworks (#6557) 2020-09-28 14:08:16 -07:00
Paul Beusterien 7ba2dd49c7 Delete redundant unused files (#6294) 2020-08-18 18:51:17 -04:00
Paul Beusterien 60927d9394 SPM - FIAM (#6257) 2020-08-12 11:21:06 -07:00
Paul Beusterien 0b977bd636 Revert "Remove #if SWIFT_PACKAGE checks for nanopb (#6163)" (#6164)
This reverts commit 303f8ca7bb.
2020-07-30 08:40:47 -07:00
Paul Beusterien 303f8ca7bb Remove #if SWIFT_PACKAGE checks for nanopb (#6163) 2020-07-30 06:49:46 -07:00
Paul Beusterien aacfe9ba74 one more internal ABT import fix (#6109) 2020-07-22 11:38:14 -07:00
Paul Beusterien 2660d49c7d ABTesting - Repo-relative imports and SwiftPM (#6013) 2020-07-09 15:48:47 -07:00
Morgan Chen c5833b3298 Fix inaccurate doc comment (#5978)
* Fix inaccurate doc comment

* Add changelog

* amend changelog
2020-07-08 09:27:41 -07:00
christibbsandPaul Beusterien 9b484519f2 Remove Protobuf from the ABT SDK (#5890)
* Remove Protobuf dependency, add struct-ish class that mimics ABTExperimentPayload

* Remove a lot of the compiler errors, but not all of them. We need to figure out how RC serializes the NSData objects passed to FIRExperimentController in updateExperimentsWithServiceOrigin:

* Add ABTExperimentPayload class that replaces generated proto, refactor classes that depend on it

* Add unit testing class for ABTExperimentPayload

* Updates to ABTExperimentPayload API, tests for ABTConditionalUserPropertyTest, add tests for ABTExperimentPayload

* Update podspec to pull in testing resources

* Add utility class for parsing test files. Use it in ABTExperimentPayloadTests

* Fix FIRExperimentController tests

* Better documentation

* Run scripts/styles.sh

* Fix whitespace

* Remove protobuf imports

* Bump pod spec version for ABT SDK, depend on new ABT SDK in RC. Fix up RemoteConfigExperiment to use new ABTExperimentPayload object

* scripts/style.sh

* Update In-app messaging to use new ABTExperimentPayload class, which involves extending the ABTExperimentPayload initializer to accept different values for overflowPolicy and experimentStartTime

* Delete test payload

* Revert scripts/check_imports.swift

* Better initialization tags for ABTExperimentLite

* Update CHANGELOGs

* Remove private headers in podspec, use integerValue to parse integers

* Refactor ABTExperimentPayload header into Private headers. Fix integer types for millisecond metadata

* scripts/styles.sh

* Fix integer parsing

* Fix copyrights

* Fix CHANGELOG typo:

* Add private_header_files to public_header_files

* Try just using NSInteger for experimentStartTimeMillis

* Bump FIAM dependency on ABTesting

* Use long long for milli parameters (32-bit apps)

* Use longlong in test timestamps

* Don't cast to nsnumber in tests

* Use in64_t

* Fix Test Overflow

* Bump major version on ABT SDK

* Bump ABTesting version in Firebase.podspec

Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
2020-07-06 13:06:39 -04:00
Paul Beusterien d653c9584c Update copyright presubmit and fix 2020 copyrights (#5944) 2020-06-29 13:16:19 -07:00
Paul Beusterien c07c89ee75 Repo-relative imports for Installations (#5832) 2020-06-17 07:26:40 -07:00
Paul Beusterien 3f556ddb9e Update GoogleUtilities' clients with repo-relative imports (#5824) 2020-06-16 09:05:29 -07:00
Paul Beusterien e15724a436 Migrate from interop pods to source_files header access (#5760) 2020-06-09 06:09:27 -07:00
Paul Beusterien d4621a636f Use preserve_paths instead of CocoaPods private (#5758) 2020-06-09 05:21:28 -07:00
Kohki Miki e640d9cb22 Add assertion when in app message is in invalid state (#5753)
* Add assertion when in app message is in invalid state

* Update FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m
2020-06-05 16:13:52 -04:00
christibbs b4faa554c3 Change log message to reference FID instead of IID (#5680)
* Change log message to reference FID instead of IID

* Add CHANGELOG entry

* Slight changelog tweak
2020-05-27 11:26:35 -04:00
christibbs a2d6fac79f Only log the URL follow event in messageClicked:withAction: if there's a URL to follow (#5564)
* Only log the URL follow event in messageClicked:withAction: if there's a URL to follow

* Add test case for empty action URL
2020-05-11 18:16:22 -04:00
rohandandavati d7e2f806cf add NSLocalizedString() (#5442) 2020-04-23 12:06:56 -04:00
christibbs c7f8825679 In banner view, pin top elements to the bottom of the status bar (#5100)
* Add constraint to pin title label below status bar in banner FIAM

* Remove title label top pin from storyboard at build time

* Use conditional compilation for iOS 13 check
2020-03-17 13:27:53 -04:00
christibbs 72397a0c42 Use FIRInstallations SDK to fetch FID and FIS token, send those values in requests to FIAM backend (#5081)
* Depend on FIRInstallations instead of IID, load an installations object into FIRInAppMessagingPrivate.h

* Bootstrap FIRInAppMessaging.h with an instance of FIRInstallations

* Update FIRIAMClientInfoFetcher to use FIRInstallations method to grab FID and FIS Token

* Call new client info fetcher method

* Fix up tests

* Change nullability for FIRInstallations object, handle null case

* More verbose comments in FIRIAMClientInfoFetcher, call completion in case that FIS token is fetched, but FID fails

* Throw error and call completion if Firebase Installations object is not created

* Send FIS token with method fetch requests

* Add test class for FIRIAMClientInfoFetcher

* Refactor FIRIAMClientInfoFetcher to get a FIRInstallations object injected

* Add unit testing for fetchFirebaseInstallationDataWithProjectNumber: in FIRIAMClientInfoFetcher

* Streamline unit tests, add case for nil FirebaseInstallations, clean up comments that were left in
2020-03-13 17:25:48 -04:00
christibbs 31385e0f6f Remove cleanup of experiments that are no longer running (#5078)
* Remove cleanup of experiments that are no longer running (product decision)

* Revert podspec bump
2020-03-11 17:13:18 -04:00
christibbs 4c776d1f74 Support AB testing of Firebase In-App Messages (#5005)
* Parse out experiment payload for experimental FIAMs and store it on FIRIAMMessageDefinition

* Fix bugs in parsing experimental payload

* Add nullable experiment payload to FIAM message definition. Add method in FIRExperimenmtController to validate running experiments and call this when new messages are fetched from FIAM backend

* Add and document new ABT methods, update FirebaseInAppMessaging.podspec to depend on ABT

* Clean up deprecated public message initializers, add experiment payload to private initializers

* Activate experiment for experimental messages upon impression

* Clean up activateExperiment API

* Add experimental payload to all message definition initializers

* Add unit test coverage for new ABT methods

* Add test coverage for parsing experimental messages

* Verify experiment payload gets passed to message superclass

* Scripts/style.sh

* Update Podfile for UI test app to include AB Testing SDK

* Add back deprecated initializers for now, these are needed for the test app

* Test for non-nil experiment payload

* Use mutable array directly, better memory usage

* Bump ABTesting podspec version, depend on new ABT in FIAM

* Remove mentions of FIREventOrigins.h

* Remove experiment payload from public API, hide it in private

* Scripts/style.sh

* Fix comment indentation, allow for FIAM to depend on minor version updates of ABTesting

* Move ABTExperimentPayload import to private header
2020-03-03 19:46:37 -05:00
rohandandavati ab818f8f8a Revert "Revert data bundles merge (#4820)" (#4922)
This reverts commit 630167b1b7.
2020-02-18 14:32:20 -08:00
rohandandavati 630167b1b7 Revert data bundles merge (#4820)
* Revert "added pragma statement to ignore initWithMessageID deprecation warning (#4754)"

This reverts commit e3854995a1.

* Revert "data bundles for consolidated sdk (#4739)"

This reverts commit 161ef56e09.
2020-02-04 15:53:45 -08:00