Last active
October 19, 2016 01:32
-
-
Save arasmussen/e197f944bb5cadbfe5192a40dbb84c1e to your computer and use it in GitHub Desktop.
Native Module to reference Loopify SDK from React Native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "RCTBridgeModule.h" | |
@interface LoopifyManager : NSObject <RCTBridgeModule> | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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