Skip to content

Commit

Permalink
adding note about where we are adding the method
Browse files Browse the repository at this point in the history
  • Loading branch information
laurajohannet committed Nov 28, 2020
1 parent df1dd5d commit 4ab243a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/native-modules-android.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ As you can see, your `CalendarModule` class extends the `ReactContextBaseJavaMod
All Java native modules in Android need to implement the `getName()` method. This method returns a string, which represents the name of the native module. The native module can then be accessed in JavaScript using its name. For example, in the below code snippet, `getName()` returns `"CalendarModule"`.

```java
// add to CalendarModule.java
@Override
public String getName() {
return "CalendarModule";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Next you will need to add a method to your native module that will create calend
Set up a method `createCalendarEvent()` for `CalendarModule` that can be invoked in JS through `CalendarModule.createCalendarEvent()`. For now, the method will take in a name and location as strings. Argument type options will be covered shortly.

```java
// add to CalendarModule.java
@ReactMethod
public void createCalendarEvent(String name, String location) {
}
Expand Down

0 comments on commit 4ab243a

Please sign in to comment.