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

Add Native Modules (iOS) guide #176

Merged
merged 1 commit into from Mar 21, 2015
Merged

Add Native Modules (iOS) guide #176

merged 1 commit into from Mar 21, 2015

Conversation

frantic
Copy link
Contributor

@frantic frantic commented Mar 21, 2015

JavaScript code can subscribe to these events:

```javascript
var subscription = RCTDeviceEventEmitter.addListener(
Copy link
Contributor

Choose a reason for hiding this comment

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

(Do we want to kill the RCT prefix from this module?)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we probably should.

-Spencer

On Mar 21, 2015, at 11:48 AM, Ben Alpert notifications@github.com wrote:

In docs/NativeModulesIOS.md:

+The native module can signal events to JavaScript without being invoked directly. The easiest way to do this is to use eventDispatcher:
+
+```objective-c
+- (void)calendarEventReminderReceived:(NSNotification *)notification
+{

  • NSString *eventName = notification.userInfo[@"name"];
  • [self.bridge.eventDispatcher sendAppEventWithName:@"EventReminder"
  •                                           body:@{@"name": eventName}];
    
    +}
    + + +JavaScript code can subscribe to these events: + +javascript
    +var subscription = RCTDeviceEventEmitter.addListener(
    (Do we want to kill the RCT prefix from this module?)


Reply to this email directly or view it on GitHub.

@sahrens
Copy link
Contributor

sahrens commented Mar 21, 2015

This is awesome - really thorough!

vjeux added a commit that referenced this pull request Mar 21, 2015
@vjeux vjeux merged commit f2dd966 into facebook:master Mar 21, 2015
// RCTCalendarManager.h
#import "RCTBridgeModule.h"

@interface RCTCalendarManager : NSObject <RCTBridgeModule>
Copy link
Contributor

Choose a reason for hiding this comment

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

RCT prefix should only be used for first-party modules, we shouldn't encourage others to use it as it will create namespace conflicts.

frantic added a commit that referenced this pull request Mar 22, 2015
@frantic frantic deleted the native-modules-guide branch March 22, 2015 00:50
acoates-ms pushed a commit to acoates-ms/react-native that referenced this pull request Oct 21, 2019
* Adding metro-config dependency

* Updating metro-config version
ayushjainrksh referenced this pull request in MLH-Fellowship/react-native Jul 2, 2020
* [TVOS] Add new properties for tvParallaxProperties

* [TVOS] Add properties for tvParallaxProperties
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.

None yet

5 participants