Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Add AppContext initializer to ExpoBridgeModule #27531

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/expo-modules-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Introduced a base class for all shared objects (`expo.SharedObject`) with a simple mechanism to release native pointer from JS. ([#27038](https://github.com/expo/expo/pull/27038) by [@tsapeta](https://github.com/tsapeta) & [#27331](https://github.com/expo/expo/pull/27331) by [@lukmccall](https://github.com/lukmccall))
- [iOS] Added native implementation of the JS EventEmitter. ([#27092](https://github.com/expo/expo/pull/27092) by [@tsapeta](https://github.com/tsapeta))
- [iOS] Allow for the export of views that conform to `AnyExpoView` ([#27284](https://github.com/expo/expo/pull/27284) by [@dominicstop](https://github.com/dominicstop))
- [iOS] Added support for bridgeless mode in React Native 0.74 ([#27242](https://github.com/expo/expo/pull/27242), [#27289](https://github.com/expo/expo/pull/27289) by [@tsapeta](https://github.com/tsapeta))
- [iOS] Added support for bridgeless mode in React Native 0.74 ([#27242](https://github.com/expo/expo/pull/27242), [#27289](https://github.com/expo/expo/pull/27289), [#27531](https://github.com/expo/expo/pull/27531) by [@tsapeta](https://github.com/tsapeta))
- [iOS] Implemented sending events from native shared objects. ([#27333](https://github.com/expo/expo/pull/27333) by [@tsapeta](https://github.com/tsapeta))
- Added support for `startObserving` and `stopObserving` in the new `EventEmitter` class. ([#27393](https://github.com/expo/expo/pull/27393) by [@tsapeta](https://github.com/tsapeta))

Expand Down
2 changes: 2 additions & 0 deletions packages/expo-modules-core/ios/Core/ExpoBridgeModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

@property (nonatomic, nullable, strong) EXAppContext *appContext;

- (nonnull instancetype)initWithAppContext:(nonnull EXAppContext *) appContext;

- (void)legacyProxyDidSetBridge:(nonnull EXNativeModulesProxy *)moduleProxy
legacyModuleRegistry:(nonnull EXModuleRegistry *)moduleRegistry;

Expand Down
8 changes: 8 additions & 0 deletions packages/expo-modules-core/ios/Core/ExpoBridgeModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ - (instancetype)init
return self;
}

- (instancetype)initWithAppContext:(EXAppContext *) appContext
{
if (self = [super init]) {
_appContext = appContext;
}
return self;
}

+ (BOOL)requiresMainQueueSetup
{
// We do want to run the initialization (`setBridge`) on the JS thread.
Expand Down
Loading