Skip to content

Instantly share code, notes, and snippets.

@arasmussen
Last active October 19, 2016 01:32
Show Gist options
  • Save arasmussen/e197f944bb5cadbfe5192a40dbb84c1e to your computer and use it in GitHub Desktop.
Save arasmussen/e197f944bb5cadbfe5192a40dbb84c1e to your computer and use it in GitHub Desktop.
Native Module to reference Loopify SDK from React Native
#import "RCTBridgeModule.h"
@interface LoopifyManager : NSObject <RCTBridgeModule>
@end
#import <Loopify/Loopify.h>
#import "LoopifyManager.h"
@implementation LoopifyManager
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(configureWithTokens:(NSString *)productToken userToken:(NSString *)userToken) {
[Loopify configureWithProductToken:productToken userToken:userToken];
}
RCT_EXPORT_METHOD(setTintColor:(UIColor *)tintColor) {
[Loopify setTintColor:tintColor];
}
RCT_EXPORT_METHOD(present) {
[Loopify present];
}
RCT_EXPORT_METHOD(dismiss) {
[Loopify dismiss];
}
// Only call these methods on the main thread
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment