SHARE
TWEET

Untitled

a guest Jun 16th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. As I passing property from React Native to native iOS you need to check for native iOS to React Native property passing.
  2.  
  3. Here is my code
  4.  
  5. In iOS
  6. **Appdelegate.h**
  7.  
  8. #import <UIKit/UIKit.h>
  9. #import "React/RCTBridgeModule.h"
  10.  
  11. @import Firebase;
  12. @interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeModule>
  13.  
  14. @property (strong, nonatomic) UIWindow *window;
  15.  
  16.  
  17. @end
  18.  
  19. **Appdelegate.m**
  20.  
  21. #import "RCTBundleURLProvider.h"
  22. #import <React/RCTLog.h>
  23.  
  24. @implementation AppDelegate
  25.  
  26. RCT_EXPORT_MODULE();
  27. RCT_EXPORT_METHOD(addEvent:(NSString *)propertyName)
  28. {
  29.     //Here you get your property value
  30.     var property = propertyName;
  31.     RCTLogInfo(@"Pretending to create an event %@ at %@", areaId);
  32. }
  33.  
  34. In React Native
  35.  
  36. MyComponent.js
  37.  
  38. import { NativeModules } from 'react-native';
  39.  
  40. var AppDelegate = NativeModules.AppDelegate;
  41. AppDelegate.addEvent(value);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top