ios - How to Implement native module in react-native? -


i following guide http://facebook.github.io/react-native/docs/nativemodulesios.html#content

and website: http://colinramsay.co.uk/2015/03/27/react-native-simple-native-module.html

but not matter add .h , .m files error: class classname not exported did forget use rtc_export_module()?

even if same code examples react-native documentation, can guide me add .h , .m files , link them project? thanks.

there has been change in native module api , seems docs haven't been updated accordingly. example in article, somestring.m should this:

//  somestring.m #import "somestring.h"  @implementation somestring  rct_export_module();  rct_export_method(get:(rctresponsesenderblock)callback) {    // change depending on want retrieve:   nsstring* somestring = @"something";    callback(@[somestring]); }  @end 

this ends desired result , can call js in same way before. looks happened:

https://github.com/facebook/react-native/commit/0686b0147c8c8084e4a226b7ea04585362eccea8


Popular posts from this blog