Skip to content

Comments

Get react native working#21

Merged
millerm30 merged 28 commits intomainfrom
get-react-native-working
Dec 10, 2025
Merged

Get react native working#21
millerm30 merged 28 commits intomainfrom
get-react-native-working

Conversation

@millerm30
Copy link
Member

@millerm30 millerm30 commented Dec 3, 2025

Description:

Notes for me before merging this in:

setup secrets for this repo. PR Open in infra for this.
https://github.com/notificationapi-com/infrastructure/pull/840

naming to be similar to react sdk => ✅
set version to 0.0.1 => ✅

Initial setup for the React Native SDK with cross-platform push notification support (Android FCM + iOS APN). Includes the core TypeScript SDK layer (NotificationAPI.ts, NotificationAPIService.ts, event system, models), Android native module with full FCM integration (NotificationApiModule.kt, NotificationApiFirebaseMessagingService.kt for handling incoming notifications), and iOS native module (NotificationApiModule.m/h with APN support and notification handling).

Updated React/React Native dependencies, added proper TypeScript types, and ensured cross-platform compatibility. The SDK now handles push notifications on both Android (FCM) and iOS (APN with automatic sandbox/production detection).

Package Cleanup & Tooling Setup

  • Removed @types/react-native (RN 0.71+ has built-in types)
  • Removed Yarn-specific resolutions field (we don't use yarn)
  • Installed and configured Prettier for code formatting
  • Installed and configured ESLint with TypeScript support
  • Added npm scripts: lint, prettier, prettier-check, type-check

CI/CD Workflows

  • Created GitHub Actions workflow for pull requests (lint, type-check)
  • Created CI pipeline for main branch (lint, type-check, publish to npm)
  • Added caching for faster builds
  • Configured Slack notifications for CI status

Documentation

  • Restructured README
  • Added APN key PEM format requirements
  • Fixed code examples (token format)

Testing:

  • iOS: Build succeeds, APN tokens formatted correctly, push notifications work (sandbox)
  • Android: Build succeeds, FCM integration working

- Introduced `NotificationApiFirebaseMessagingService` to handle incoming Firebase messages and display notifications.
- Added `NOTIFICATION_RECEIVED` event to `NotificationApiEvent` for React Native integration.
- Updated `NotificationApiModule` to store React context for access in the new service.
- Enhanced notification display logic with proper handling of notification channels and intents.
…tionAPI integration

- Expanded the Android setup section to include step-by-step guidance for creating a Firebase project, connecting NotificationAPI to FCM, and configuring the React Native project.
- Added detailed instructions for implementing `FirebaseMessagingService` and initializing the NotificationAPI SDK.
- Included troubleshooting tips for common issues related to Firebase integration.
…ions

- Upgraded `actions/checkout` from v3 to v4 for improved performance.
- Updated `actions/setup-node` to v4 and changed Node.js version from 18.x to 20 for better compatibility and features.
- Ensured the workflow remains efficient and up-to-date with the latest best practices.
- Added caching for `node_modules` to improve build performance.
- Introduced a type check step to ensure code quality before deployment.
- Updated the checkout step with a descriptive name for clarity.
- Introduced a new `.prettierrc` file for consistent code formatting.
- Added Prettier as a development dependency in `package.json` and `package-lock.json`.
- Created scripts for formatting and checking code with Prettier.
- Updated GitHub Actions workflow to include a step for checking code formatting with Prettier.
…e-lock.json

- Bumped @types/react-native from 0.72.0 to 0.73.0.
- Updated React and React Native versions to require minimum versions of 18.0.0 and 0.73.0 respectively.
- Removed deprecated entries and ensured peer dependencies reflect the latest requirements.
…versions

- Added a new section outlining the minimum required versions for React Native (>= 0.73.0) and React (>= 18.0.0).
- Included a note regarding the necessity of the New Architecture for compatibility with the SDK.
- Introduced a new ESLint configuration file (`eslint.config.mjs`) to enforce coding standards and best practices.
- Updated `package.json` and `package-lock.json` to include ESLint and TypeScript ESLint dependencies.
- Added a linting script to the `package.json` for easy linting of TypeScript files.
- Enhanced GitHub Actions workflow to include a linting step for code quality assurance.
- Modified the workflow to run both linting and Prettier formatting checks in parallel, improving efficiency.
- Removed the separate Prettier check step to streamline the process.
- Changed the dependency installation command from `npm install` to `npm ci --prefer-offline` for improved performance and reliability in CI environments.
@millerm30 millerm30 marked this pull request as draft December 3, 2025 20:14
- Introduced a new GitHub Actions workflow (`ci.yml`) to automate the CI process.
- Configured steps for code checkout, Node.js setup, dependency caching, installation, linting, type checking, and publishing to NPM.
- Added Slack notifications for both success and failure scenarios to enhance visibility of the CI process.
- Replaced the Slack notification action with the official `slackapi/slack-github-action` for improved functionality.
- Enhanced success and failure notifications with detailed messages and structured payloads for better visibility in Slack.
- Updated webhook configuration to align with the new action's requirements.
- Added a condition to the pull request pipeline to only run when the pull request is not a draft, improving workflow efficiency.
…otification handling

- Changed NotificationApiModule to inherit from RCTEventEmitter for enhanced event management.
- Updated notification presentation options for iOS 14 and above to use banners instead of alerts, improving user experience.
… eliminate unnecessary type definitions, as React Native provides its own types. This change streamlines the dependency management for the project.
- Introduced a new LICENSE file with the MIT License text.
- Updated README.md to enhance clarity and organization, including a new section for Quick Start and detailed setup instructions for both iOS and Android.
- Improved feature descriptions and added troubleshooting tips for common issues related to push notifications.
…in NotificationAPI

- Changed the podspec to use the correct repository URL format for source.
- Updated the NotificationAPI to set the iOS environment to 'sandbox' for debug builds and 'production' for release builds, enhancing clarity in environment configuration.
…atting

- Added a note in the APN configuration section to include PEM headers when uploading the APN key to NotificationAPI.
- Updated the token formatting in the AppDelegate example to use lowercase hex representation for consistency.
…n; update README.md with simplified local testing instructions and linking steps for the SDK.
@millerm30 millerm30 marked this pull request as ready for review December 5, 2025 14:04
@millerm30 millerm30 requested a review from sahandseifi December 5, 2025 14:04
…adability

- Reformatted the environment assignment logic in NotificationAPI to enhance clarity and maintainability, ensuring better understanding of iOS environment settings.
@millerm30 millerm30 marked this pull request as draft December 5, 2025 14:17
@millerm30 millerm30 marked this pull request as ready for review December 5, 2025 14:41
- Changed package name from 'notificationapi-react-native-sdk' to '@notificationapi/react-native'.
- Updated version from '1.0.0' to '0.0.1'.
- Modified installation and import instructions in README.md to reflect the new package name.
Copy link
Member

@sahandseifi sahandseifi left a comment

Choose a reason for hiding this comment

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

minor comments about readme. merge after.

- Removed unnecessary whitespace throughout the file for better readability.
- Enhanced the method table formatting for clearer presentation.
- Added spacing in code snippets and important notes for improved visibility.
- Streamlined event data sections to maintain consistency in formatting.
@millerm30 millerm30 merged commit dc0816f into main Dec 10, 2025
1 check passed
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.

2 participants