This file contains 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
{ | |
'plugins': [ | |
new CompressionPlugin({ | |
test: /\.js$|\.css$|\.html$/ | |
}) | |
] | |
} |
This file contains 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
toolbox.router.get('(.*).js', toolbox.fastest, { | |
'origin':/.herokuapp.com|localhost|maps.googleapis.com/, | |
'mode':'cors', | |
'cache': { | |
'name': `js-assets-${VERSION}`, | |
'maxEntries': 50, | |
'maxAgeSeconds': 2592e3 | |
} | |
}); |
This file contains 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
res.setHeader("Expires", new Date(Date.now() + 2592000000).toUTCString()); |
This file contains 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 { Component } from 'react'; | |
export default class SSOExample extends Component { | |
render () { | |
return ( | |
<View style={styles.container}> | |
<TouchableHighlight onPress={() => {}}> | |
<View style={styles.button}> | |
<Text style={styles.buttonText}>Connect with Twitter</Text> | |
</View> |
This file contains 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
// TwitterSignin.h | |
#import "React/RCTBridge.h" | |
#import <Foundation/Foundation.h> | |
@interface TwitterSignin : NSObject <RCTBridgeModule> | |
@end |
This file contains 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
// TwitterSignin.m | |
#import <Fabric/Fabric.h> | |
#import <TwitterKit/TwitterKit.h> | |
#import "React/RCTEventDispatcher.h" | |
#import "TwitterSignin.h" | |
@implementation TwitterSignin | |
//specifing to use main-thread-only iOS API |
This file contains 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 { Text, View, TouchableHighlight, NativeModules, Alert } from 'react-native'; | |
const { TwitterSignin } = NativeModules; | |
... | |
onLoginClick() { | |
TwitterSignin.logIn((error, loginData) => { | |
if (error) { | |
// Login failed | |
Alert.alert('Error'); | |
return; | |
} |
This file contains 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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, |
This file contains 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
// TwitterSignin.m | |
#import <Fabric/Fabric.h> | |
#import <TwitterKit/TwitterKit.h> | |
#import "React/RCTEventDispatcher.h" | |
#import "TwitterSignin.h" | |
@implementation TwitterSignin | |
//specifing to use main-thread-only iOS API |
This file contains 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
// TwitterSignin.m | |
#import <Fabric/Fabric.h> | |
#import <TwitterKit/TwitterKit.h> | |
#import "React/RCTEventDispatcher.h" | |
#import "TwitterSignin.h" | |
@implementation TwitterSignin | |
// To export a module named TwitterSignin |