This PR introduces a complete rewrite of our sample apps. It is massive PR so I will do my best to narrow down the effective areas that needs deep review.
Setup and Structure
By default a React Native (RN) library's sample app is located in the example folder. This applies to our case.
All the RN source codeexample/src
All the CustomerIO.* usage can be seen in example/src/App.tsx
Native iOS codebase base is split in three places:
example/ios/Shared This is where most of the native code lives.
example/ios/APN contains the files (currently Info.plist and constants.swift) that contains values applicable to the APN sample app only.
example/ios/FCM contains the files (currently Info.plist and constants.swift) that contains values applicable to the FCM sample app only.
Native iOS Xcode Workspace includes 4 targets. APN target with its NSE target, and FCM target and its NSE target as well.
example/ios/Podfile sets up the dependencies for each target and points to local paths to make it easier to debug the native SDK locally.
When running the app, QA settings can be seen if you long-press the settings button
Review
This is a massive PR, it can be broken down for sure. However, since the sample code isn't meant to be production-perfect, I think we can channel the review efforts in the most relevant areas that ensures the apps are setup properly, and they are making a valid use of the SDK.
To that extent, I would recommend focusing on:
example/src/App.tsx as this is the entry point for anyone examining the app as a usage sample.
example/package.json To make sure it doesn't do anything that's not applicable for production apps and could cause us to miss issues that would otherwise surface in a production setup.
Examine the iOS setup (instructions below on how to get it up and running)
Ignore the entire Android setup as there is nothing done for it so far. All you will see are template files. These should be introduced later when Android CDP is ready.
yarn example ios-apn or yarn example ios-cfm to run either the APN or FCM apps
Context
We are rebuilding our React Native (RN) SDK to support Customer.io's Data Pipelines.
Public Changes
SDK Changes
Modernized our RN package to use the latest configurations and dependencies available in RN version 0.74.2.
Simplified our configuration to provide the minimum number of settings that make sense for our customers.
Added support to view native debug logs directly in the console alongside other console.* logs.
Example Apps
Created customer-oriented example apps where you can build, run, debug, and see the SDK usage in the App.tsx file.
Internal Changes
SDK Dev Environment Setup
Removed the pre-push hook that runs lint, as it can be challenging when lint fails before a push in a PR stack setup. Linting has been moved to the pre-commit hook.
Implemented yarn workspace for easier management of example apps.
Configured example apps to point to local paths for all native CIO pods, facilitating easier debugging and validation of native changes.
Made the native iOS repo a git submodule of this repo, simplifying the process of starting and validating relevant native changes within the RN repo.
Unified the example app codebase for both APN and FCM configurations, making it easier to maintain.
Included yarn release to ensure a consistent development experience.
Added yarn.lock to .gitignore.
QA Setup
Dev endpoints for QA can still be set in the example apps with a long-press on the settings button. This allows us to perform QA configurations without affecting customer-oriented examples.
This PR introduces a complete rewrite of our sample apps. It is massive PR so I will do my best to narrow down the effective areas that needs deep review.
Setup and Structure
example
folder. This applies to our case.example/src
example/src/App.tsx
example/ios/Shared
This is where most of the native code lives.example/ios/APN
contains the files (currently Info.plist and constants.swift) that contains values applicable to the APN sample app only.example/ios/FCM
contains the files (currently Info.plist and constants.swift) that contains values applicable to the FCM sample app only.example/ios/Podfile
sets up the dependencies for each target and points to local paths to make it easier to debug the native SDK locally.Review
This is a massive PR, it can be broken down for sure. However, since the sample code isn't meant to be production-perfect, I think we can channel the review efforts in the most relevant areas that ensures the apps are setup properly, and they are making a valid use of the SDK. To that extent, I would recommend focusing on:
example/src/App.tsx
as this is the entry point for anyone examining the app as a usage sample.example/package.json
To make sure it doesn't do anything that's not applicable for production apps and could cause us to miss issues that would otherwise surface in a production setup.Steps to run the app locally
git clone https://github.com/customerio/customerio-reactnative --recursive
cd customerio-reactnative
yarn install
yarn example pods
yarn example ios-apn
oryarn example ios-cfm
to run either the APN or FCM appsContext
We are rebuilding our React Native (RN) SDK to support Customer.io's Data Pipelines.
Public Changes
console.*
logs.App.tsx
file.Internal Changes
pre-push
hook that runslint
, as it can be challenging when lint fails before a push in a PR stack setup. Linting has been moved to thepre-commit
hook.yarn
workspace for easier management of example apps.yarn
release to ensure a consistent development experience.yarn.lock
to.gitignore
.QA Setup
PR Stack:
282
280
279
278
277