Skip to content

Conversation

@fadi-george
Copy link
Collaborator

@fadi-george fadi-george commented Sep 29, 2025

Description

One Line Summary

  • adds custom events support for the react native package
Screenshot 2025-09-30 at 4 28 01 PM Screenshot 2025-09-30 at 4 15 28 PM

Details

  • sets versions of android and ios to versions that have custom events logic
  • expose android trackEvent method via RNOneSignal.java
  • expose ios trackEvent method via RCTOneSignalEventEmitter.m
  • add new trackEvent react-native method via src/index.ts
  • removed material ui package for react native example
  • adds trackEvent demo action for the example project

Motivation

Code change is to allow developers to use custom-events with the react-native package.

Testing

Manual testing

Run ios and android emulators and tested the trackEvent action. See screenshot of the custom event actually being recorded.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

add android track event method

expose ios trackEvent method
update min version of ios
fix android & ios example
@fadi-george fadi-george changed the title ZXzX feat: add custom events support Sep 29, 2025
@nan-li
Copy link
Contributor

nan-li commented Sep 29, 2025

Do not merge to main

@fadi-george fadi-george force-pushed the fadi/sdk-2947-add-custom-events-for-react-native-package branch from 5eb8b84 to 70d188c Compare September 29, 2025 23:31
@fadi-george fadi-george requested a review from nan-li September 29, 2025 23:58
@fadi-george fadi-george force-pushed the fadi/sdk-2947-add-custom-events-for-react-native-package branch from da43fed to 087efef Compare September 30, 2025 19:33
@fadi-george fadi-george force-pushed the fadi/sdk-2947-add-custom-events-for-react-native-package branch from 087efef to 456a302 Compare September 30, 2025 19:40
@fadi-george fadi-george force-pushed the fadi/sdk-2947-add-custom-events-for-react-native-package branch from 927617e to f1a5cc3 Compare September 30, 2025 23:13
@fadi-george fadi-george requested a review from nan-li October 1, 2025 18:30
@fadi-george fadi-george force-pushed the fadi/sdk-2947-add-custom-events-for-react-native-package branch from fe04bdf to 7f19633 Compare October 1, 2025 19:03
@fadi-george fadi-george force-pushed the fadi/sdk-2947-add-custom-events-for-react-native-package branch from 7f19633 to 17c5156 Compare October 1, 2025 19:17
@nan-li nan-li self-requested a review October 1, 2025 20:15
Copy link
Contributor

@nan-li nan-li left a comment

Choose a reason for hiding this comment

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

Approved but blocking until the base of the PR changes

@fadi-george fadi-george changed the base branch from main to rel/5.3-beta October 1, 2025 20:40
@fadi-george fadi-george requested a review from nan-li October 1, 2025 20:42
@fadi-george fadi-george merged commit 1613fcd into rel/5.3-beta Oct 1, 2025
4 checks 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.

4 participants