Skip to content

Conversation

@subhankarmaiti
Copy link
Contributor

@subhankarmaiti subhankarmaiti commented Dec 18, 2025

Fixes EXC_BAD_ACCESS (code=1, address=0x20) crash on iOS introduced in #1414 when upgrading to React Native 0.83.0.

Changes Made

iOS Native Bridge (ios/A0Auth0.mm)

  • Changed all numeric parameters from NSInteger to double to match JavaScript's number type
  • Added explicit (NSInteger) casts when passing values to Swift methods
  • Updated parameters: minTTL in getCredentials, hasValidCredentials, getApiCredentials
  • Updated webAuth method to use doubleValue instead of integerValue for maxAge, leeway, and safariViewControllerPresentationStyle

Android

  • ✅ No changes required - Android implementation was already using Double type correctly

🧪 Testing

  • iOS example app builds and runs without crashes
  • Android example app builds and runs (no regression)
  • All numeric parameters pass correctly through the native bridge
  • Unit tests pass
  • TypeScript type checking passes

🔗 Related

@subhankarmaiti subhankarmaiti requested a review from a team as a code owner December 18, 2025 08:53
@NandanPrabhu
Copy link

@subhankarmaiti were you able to replicate the crash?

@subhankarmaiti
Copy link
Contributor Author

Yes @NandanPrabhu , and after this change it got fixed

@pmathew92 pmathew92 requested a review from Copilot December 18, 2025 09:51
@subhankarmaiti subhankarmaiti merged commit 12069b8 into master Dec 18, 2025
3 checks passed
@subhankarmaiti subhankarmaiti deleted the fix/int32-type-marshaling-crash branch December 18, 2025 09:51
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 fixes an EXC_BAD_ACCESS crash on iOS that occurred after upgrading to React Native 0.83.0, caused by a type mismatch in the native bridge between JavaScript's number type and Objective-C's NSInteger type.

  • Changed iOS native bridge parameter types from NSInteger to double to match JavaScript's number type
  • Added explicit (NSInteger) casts when passing values to Swift methods that expect Int
  • Aligned iOS implementation with Android, which already uses Double for these parameters

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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