Skip to content

Conversation

@lposen
Copy link
Collaborator

@lposen lposen commented Mar 28, 2025

Add iterable integration

Test

  1. cd into root folder
  2. run npm install
  3. run npm run prepare
  4. cd into example folder
  5. run npm install
  6. add your iterable api key to the app.json file
  7. run npx expo prebuild --clean
  8. run the app
    -- android: npx expo run:android
    -- ios: npx expo run: ios
  9. login with your email
  10. you should now see your iterable inbox

Screenshots

android ios
Screenshot 2025-03-27 at 9 11 22 PM Screenshot 2025-03-27 at 9 11 22 PM
Screenshot 2025-03-27 at 9 11 22 PM Screenshot 2025-03-27 at 9 11 22 PM

@lposen lposen marked this pull request as ready for review March 28, 2025 21:15
@lposen lposen requested a review from Copilot March 31, 2025 23:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates Iterable into the test app and adds relevant color constants for styling consistency.

  • Adds Iterable dependency to iOS podspec and integrates Iterable SDK in the login flow.
  • Refactors module imports and updates color constants to support Iterable features.
  • Updates file structure by moving App.tsx into the src folder and removing the old implementation.

Reviewed Changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ios/ExpoAdapterIterable.podspec Adds Iterable dependency for React Native integration.
example/src/index.ts Exports the App component from the updated location.
example/src/constants/index.ts Re-exports color constants from colors.ts.
example/src/constants/colors.ts Defines extensive color constants and types for styling.
example/src/Login.tsx Implements the login screen with Iterable initialization.
example/src/App.tsx Configures navigation between login and Iterable inbox.
example/index.ts Updates the entry point to use the new src folder.
example/App.tsx Removes outdated App implementation.
.github/pull_request_template.md Adds pull request template with instructions and screenshots.
Files not reviewed (4)
  • android/src/main/java/expo/modules/adapters/iterable/ExpoAdapterIterableModule.kt: Language not supported
  • example/package.json: Language not supported
  • example/tsconfig.json: Language not supported
  • package.json: Language not supported

@lposen lposen requested a review from Copilot April 1, 2025 19:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates Iterable into the test app, enabling an in-app Iterable inbox feature. Key changes include adding an Iterable dependency in the iOS podspec, refactoring the file structure to support the new integration, and introducing a new Login component that initializes and sets up Iterable.

Reviewed Changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ios/ExpoAdapterIterable.podspec Added dependency on Iterable-React-Native-SDK
example/src/index.ts Updated export path to load App from the appropriate source directory
example/src/constants/colors.ts Added comprehensive color constants supporting consistent app theming
example/src/Login.tsx Introduced a Login component that initializes Iterable and triggers login flow
example/src/App.tsx Updated App component to conditionally render Iterable inbox or Login
example/index.ts Modified import path to adapt to the new file structure
example/App.tsx (removed) Removed obsolete App file
.github/pull_request_template.md Added pull request template for consistent PR documentation
Files not reviewed (4)
  • android/src/main/java/expo/modules/adapters/iterable/ExpoAdapterIterableModule.kt: Language not supported
  • example/package.json: Language not supported
  • example/tsconfig.json: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

example/index.ts:3

  • Ensure that the updated import path correctly references the intended module, as the change from './App' to './src' may lead to naming mismatches if the exported component is not properly aligned.
import App from './src';

Comment on lines +52 to +56
const onPress = () => {
Iterable.setEmail(email);
setTimeout(() => {
onLoggedIn();
}, 300);
Copy link

Copilot AI Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a fixed delay with setTimeout for navigation may cause timing issues on slower devices. Consider using a callback or promise resolution from the Iterable initialization to ensure reliable transition.

Suggested change
const onPress = () => {
Iterable.setEmail(email);
setTimeout(() => {
onLoggedIn();
}, 300);
const onPress = async () => {
Iterable.setEmail(email);
await Iterable.initialize(getApiKey(), new IterableConfig());
onLoggedIn();

Copilot uses AI. Check for mistakes.
Base automatically changed from MOB-11119-create-api-key-generator to main April 2, 2025 04:15
@lposen lposen requested a review from Copilot April 2, 2025 04:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Iterable integration to the test app by updating dependencies, reorganizing the project structure, and implementing a login screen that initializes the Iterable SDK.

  • Updated the iOS podspec to include the Iterable React Native SDK.
  • Introduced new files in the example app for colors, constants, and login functionality.
  • Adjusted the app's entry point and removed a dummy App component to streamline the integration.

Reviewed Changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ios/ExpoAdapterIterable.podspec Added dependency for Iterable React Native SDK
example/src/index.ts Updated export to point to the App component
example/src/constants/{index,colors}.ts Introduced and organized colors and constants
example/src/Login.tsx Added Login component for Iterable initialization
example/src/App.tsx Integrated IterableInbox with conditional rendering
example/index.ts Updated file import to reflect new project structure
example/App.tsx Removed outdated App component
.github/pull_request_template.md Added PR template for documentation and testing guidance
Files not reviewed (4)
  • example/android/app/src/main/AndroidManifest.xml: Language not supported
  • example/package.json: Language not supported
  • example/tsconfig.json: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (2)

example/src/Login.tsx:80

  • [nitpick] Consider using onPress instead of onPressOut to ensure a more standard and consistent user interaction for triggering the login action.
onPressOut={onPress}

example/src/Login.tsx:54

  • [nitpick] Consider replacing the hardcoded 300ms delay with a named constant to improve readability and maintainability.
setTimeout(() => {

Copy link
Contributor

@evantk91 evantk91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified with iOS and android. Just some comments.

Please explain the steps needed to verify your change.

## 📝 Documentation

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this file is used for. Can we remove?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's supposed to give a base template for the pull requests, but it's not working for some reason

</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
<meta-data android:name="ITERABLE_API_KEY" android:value="YOUR_ITERABLE_API_KEY"/>
<meta-data android:name="ITERABLE_API_KEY" android:value="be63942e7f1e425b9923c4d86596528c"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like API key was accidently pushed up

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoot!!!! i'll disable it

"main": "index.ts",
"scripts": {
"start": "expo start",
"start": "expo start --dev-client",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does --dev-client do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sure that it doesn't run with expo go, which cannot work with our app since it requires that you do not use native files (ie: swift, kotlin, etc)

@lposen lposen merged commit dbedac0 into main Apr 2, 2025
@lposen lposen deleted the MOB-11120-add-iterable-to-test-app branch April 2, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants