From f09ccf6a4f4680d968ab7ec18d2c88d51f405aa9 Mon Sep 17 00:00:00 2001 From: Evan Masseau <> Date: Fri, 9 Feb 2024 11:29:33 -0500 Subject: [PATCH 1/5] To make proper use of bundle, lockfile needs to be committed. I specified a cocoapods version since podfile.lock contains cocoapods version! Add explicit instructions about example app --- README.md | 8 ++++ example/Gemfile | 2 +- example/Gemfile.lock | 101 +++++++++++++++++++++++++++++++++++++++ example/ios/Podfile.lock | 2 +- 4 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 example/Gemfile.lock diff --git a/README.md b/README.md index faff9f9..41a561b 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,14 @@ npm install klaviyo-react-native-sdk yarn add klaviyo-react-native-sdk ``` +### Example App +We have included a bare-bones example app in this repository for reference. To run the example app: +- Make a local clone of this repository +- Run `yarn install --immutable` from the root directory +- Navigate to the `example` directory and run `bundle install` +- Navigate to the `example/ios` directory and run `bundle exec pod install` +- Run `yarn start` from the root directory + ### Android Android installation requirements may vary depending upon your project configuration and other dependencies. The Klaviyo React Native SDK's `build.gradle` file exposes transitive dependencies upon the Klaviyo Android SDK, diff --git a/example/Gemfile b/example/Gemfile index 6a7d5c7..a63b309 100644 --- a/example/Gemfile +++ b/example/Gemfile @@ -3,5 +3,5 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version ruby ">= 2.6.10" -gem 'cocoapods', '~> 1.13' +gem 'cocoapods', '1.14.3' gem 'activesupport', '>= 6.1.7.3', '< 7.1.0' diff --git a/example/Gemfile.lock b/example/Gemfile.lock new file mode 100644 index 0000000..096740a --- /dev/null +++ b/example/Gemfile.lock @@ -0,0 +1,101 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.6) + rexml + activesupport (6.1.7.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + claide (1.1.0) + cocoapods (1.14.3) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.14.3) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 2.1, < 3.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.23.0, < 2.0) + cocoapods-core (1.14.3) + activesupport (>= 5.0, < 8) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) + cocoapods-downloader (2.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.2.0) + colored2 (3.1.2) + concurrent-ruby (1.2.3) + escape (0.0.4) + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.16.3) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + httpclient (2.8.3) + i18n (1.14.1) + concurrent-ruby (~> 1.0) + json (2.7.1) + minitest (5.22.2) + molinillo (0.8.0) + nanaimo (0.3.0) + nap (1.1.0) + netrc (0.11.0) + public_suffix (4.0.7) + rexml (3.2.6) + ruby-macho (2.5.1) + typhoeus (1.4.1) + ethon (>= 0.9.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + xcodeproj (1.24.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + zeitwerk (2.6.13) + +PLATFORMS + ruby + +DEPENDENCIES + activesupport (>= 6.1.7.3, < 7.1.0) + cocoapods (= 1.14.3) + +RUBY VERSION + ruby 2.6.10p210 + +BUNDLED WITH + 1.17.2 diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 40c5145..e99bf4e 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1379,7 +1379,7 @@ SPEC CHECKSUMS: React-utils: debda2c206770ee2785bdebb7f16d8db9f18838a ReactCommon: ddb128564dcbfa0287d3d1a2d10f8c7457c971f6 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 - Yoga: 4f53dc50008d626fa679c7a1cb4bed898f8c0bde + Yoga: 2b33a7ac96c58cdaa7b810948fc6a2a76ed2d108 PODFILE CHECKSUM: 4b9faf5e512fab6e8d87beb30570ec4d3bd884b9 From 6c36711d850b351677764a7079cedef415c93d7f Mon Sep 17 00:00:00 2001 From: Evan Masseau <> Date: Wed, 21 Feb 2024 15:43:44 -0500 Subject: [PATCH 2/5] Added alias for entire example app setup script Try updating CI step to use gem to pin cocoapods version --- .github/workflows/ios-ci.yml | 3 +-- README.md | 16 ++++++++++------ package.json | 1 + 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ios-ci.yml b/.github/workflows/ios-ci.yml index 8b5a3e6..0a988d4 100644 --- a/.github/workflows/ios-ci.yml +++ b/.github/workflows/ios-ci.yml @@ -58,8 +58,7 @@ jobs: - name: Install cocoapods if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' run: | - cd example/ios - pod install + yarn example-setup env: NO_FLIPPER: 1 diff --git a/README.md b/README.md index 9fed9fb..a2253b5 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,16 @@ yarn add klaviyo-react-native-sdk ``` ### Example App -We have included a bare-bones example app in this repository for reference. To run the example app: -- Make a local clone of this repository -- Run `yarn install --immutable` from the root directory -- Navigate to the `example` directory and run `bundle install` -- Navigate to the `example/ios` directory and run `bundle exec pod install` -- Run `yarn start` from the root directory +We have included a bare-bones example app in this repository for reference of how to integrate with our SDK. +It is primarily intended to give code samples such as how and where to `initialize` or how to implement notification +delegate methods on iOS. To actually run the example app: +- Clone this repository +- From the root directory, run `yarn example-setup`. This is an alias that will to the following: + - Run `yarn install --immutable` from the root directory + - Navigate to the `example` directory and run `bundle install` + - Navigate to the `example/ios` directory and run `bundle exec pod install` +- From the project's root directory, run `yarn example start` to start the example application. Follow the + metro instructions from here, i.e. press `i` to run on iOS or `a` to run on Android. ### Android Android installation requirements may vary depending upon your project configuration and other dependencies. diff --git a/package.json b/package.json index a1a9b67..f4e61d0 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "!**/.*" ], "scripts": { + "example-setup": "(yarn install --immutable && cd example && bundle install && cd ios && bundle exec pod install)", "example": "yarn workspace klaviyo-react-native-sdk-example", "test": "jest", "typecheck": "tsc --noEmit", From ac10b9f482e915806a9de9582168f1a4ddcc855f Mon Sep 17 00:00:00 2001 From: Evan Masseau <> Date: Wed, 21 Feb 2024 15:44:21 -0500 Subject: [PATCH 3/5] do --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2253b5..8226929 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ We have included a bare-bones example app in this repository for reference of ho It is primarily intended to give code samples such as how and where to `initialize` or how to implement notification delegate methods on iOS. To actually run the example app: - Clone this repository -- From the root directory, run `yarn example-setup`. This is an alias that will to the following: +- From the root directory, run `yarn example-setup`. This is an alias that will do the following: - Run `yarn install --immutable` from the root directory - Navigate to the `example` directory and run `bundle install` - Navigate to the `example/ios` directory and run `bundle exec pod install` From 8d857f756f3d1a7f01756309514763015ca58a54 Mon Sep 17 00:00:00 2001 From: Evan Masseau <> Date: Wed, 21 Feb 2024 15:52:57 -0500 Subject: [PATCH 4/5] srsly --- .github/workflows/ios-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ios-ci.yml b/.github/workflows/ios-ci.yml index 0a988d4..4f4e3a2 100644 --- a/.github/workflows/ios-ci.yml +++ b/.github/workflows/ios-ci.yml @@ -59,6 +59,9 @@ jobs: if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' run: | yarn example-setup + cat example/ios/.xcode.env + cat example/ios/.xcode.env.local + echo $(command -v node) env: NO_FLIPPER: 1 From a7e1b1df1866749ec3624b205c75ad5b5f3ee056 Mon Sep 17 00:00:00 2001 From: Evan Masseau <> Date: Wed, 21 Feb 2024 15:58:41 -0500 Subject: [PATCH 5/5] Should fix the iOS ci??? --- .github/workflows/ios-ci.yml | 4 +-- .../KlaviyoReactNativeSdkExample/Info.plist | 34 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ios-ci.yml b/.github/workflows/ios-ci.yml index 4f4e3a2..d067b23 100644 --- a/.github/workflows/ios-ci.yml +++ b/.github/workflows/ios-ci.yml @@ -59,9 +59,7 @@ jobs: if: env.turbo_cache_hit != 1 && steps.cocoapods-cache.outputs.cache-hit != 'true' run: | yarn example-setup - cat example/ios/.xcode.env - cat example/ios/.xcode.env.local - echo $(command -v node) + rm -f example/ios/.xcode.env.local env: NO_FLIPPER: 1 diff --git a/example/ios/KlaviyoReactNativeSdkExample/Info.plist b/example/ios/KlaviyoReactNativeSdkExample/Info.plist index d3c31b6..10ae9db 100644 --- a/example/ios/KlaviyoReactNativeSdkExample/Info.plist +++ b/example/ios/KlaviyoReactNativeSdkExample/Info.plist @@ -20,8 +20,25 @@ $(MARKETING_VERSION) CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLName + org.reactjs.native.example.KlaviyoReactNativeSdkExample.deeplink + CFBundleURLSchemes + + rntest + + + CFBundleVersion $(CURRENT_PROJECT_VERSION) + LSApplicationQueriesSchemes + + rntest + LSRequiresIPhoneOS NSAppTransportSecurity @@ -47,22 +64,5 @@ UIViewControllerBasedStatusBarAppearance - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLName - org.reactjs.native.example.KlaviyoReactNativeSdkExample.deeplink - CFBundleURLSchemes - - rntest - - - - LSApplicationQueriesSchemes - - rntest -