Skip to content

Commit

Permalink
Update calls to reflect changed API
Browse files Browse the repository at this point in the history
  • Loading branch information
enricogior committed Dec 18, 2017
1 parent 3091985 commit fabe4da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 4 additions & 6 deletions src/android/jni/cordova-bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,16 @@ napi_value Method_SendMessage(napi_env env, napi_callback_info info) {
return nullptr;
}

#define DECLARE_NAPI_METHOD(name, func) \
{ \
name, 0, func, 0, 0, 0, napi_default, 0 \
}
#define DECLARE_NAPI_METHOD(name, func) { name, 0, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module, void *priv) {
napi_value Init(napi_env env, napi_value exports) {
napi_status status;
napi_property_descriptor properties[] = {
DECLARE_NAPI_METHOD("send", Method_SendMessage),
DECLARE_NAPI_METHOD("setListener", Method_RegisterListener),
};
status = napi_define_properties(env, exports, sizeof(properties) / sizeof(*properties), properties);
NAPI_CALL(env, napi_define_properties(env, exports, sizeof(properties) / sizeof(*properties), properties));
return exports;
}

void SendToBridge(const char *message) {
Expand Down
5 changes: 3 additions & 2 deletions src/ios/NativeModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,14 @@ napi_value Method_SendMessage(napi_env env, napi_callback_info info) {

#define DECLARE_NAPI_METHOD(name, func) { name, 0, func, 0, 0, 0, napi_default, 0 }

void Init(napi_env env, napi_value exports, napi_value module, void* priv) {
napi_value Init(napi_env env, napi_value exports) {
napi_status status;
napi_property_descriptor properties[] = {
DECLARE_NAPI_METHOD("send", Method_SendMessage),
DECLARE_NAPI_METHOD("setListener", Method_RegisterListener),
};
status = napi_define_properties(env, exports, sizeof(properties) / sizeof(*properties), properties);
NAPI_CALL(env, napi_define_properties(env, exports, sizeof(properties) / sizeof(*properties), properties));
return exports;
}

/**
Expand Down

0 comments on commit fabe4da

Please sign in to comment.