Skip to content

Commit

Permalink
Release React Native SDK v.1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiffany Lu committed Sep 25, 2017
1 parent 8816062 commit d41fc03
Show file tree
Hide file tree
Showing 76 changed files with 3,480 additions and 125 deletions.
4 changes: 2 additions & 2 deletions AppboyProject/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["react-native"]
}
"presets": ["react-native"]
}
11 changes: 6 additions & 5 deletions AppboyProject/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ node_modules/react-native/flow
flow/

[options]
module.system=haste
emoji=true

experimental.strict_type_args=true
module.system=haste

munge_underscores=true

Expand All @@ -34,11 +34,12 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-7]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-7]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.37.0
^0.49.1
1 change: 0 additions & 1 deletion AppboyProject/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ yarn-error.log
# BUCK
buck-out/
\.buckd/
android/app/libs
*.keystore

# fastlane
Expand Down
55 changes: 32 additions & 23 deletions AppboyProject/AppboyProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ const ReactAppboy = require('react-native-appboy-sdk');
class AppboyProject extends Component {
constructor(props) {
super(props);
this.state = { userIdText : 'theAppboyTestUser' };
this.state = {
userIdText : 'theAppboyTestUser',
customEventText : ''
};
this._updateCardCount = this._updateCardCount.bind(this);
this._changeUserPress = this._changeUserPress.bind(this);
this._logCustomEventPress = this._logCustomEventPress.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -84,24 +88,26 @@ class AppboyProject extends Component {
render() {
return (
<View style={styles.container}>
<View style={{
flexDirection: 'row',
alignItems: 'center'
}}>
<TouchableHighlight
onPress={this._changeUserPress}>
<Text>Click to Set User ID:</Text>
</TouchableHighlight>
<View style={styles.row}>
<TextInput
style={{height: 40, width: 150, borderColor: 'gray', borderWidth: .5, paddingLeft: 5, marginLeft: 5, fontSize: 14 }}
style={styles.textInput}
onChangeText={(userIdText) => this.setState({userIdText})}
value={this.state.userIdText}
/>
<TouchableHighlight
onPress={this._changeUserPress}>
<Text>Set User ID</Text>
</TouchableHighlight>
</View>
<View style={styles.row}>
<TextInput
style={styles.textInput}
onChangeText={(customEventText) => this.setState({customEventText})}/>
<TouchableHighlight
onPress={this._logCustomEventPress}>
<Text>Log Custom Event</Text>
</TouchableHighlight>
</View>
<TouchableHighlight
onPress={this._logCustomEventPress}>
<Text>Log Custom Event</Text>
</TouchableHighlight>
<TouchableHighlight
onPress={this._logPurchasePress}>
<Text>Log Purchase</Text>
Expand Down Expand Up @@ -168,7 +174,7 @@ class AppboyProject extends Component {
ReactAppboy.changeUser(this.state.userIdText);
}
_logCustomEventPress(event) {
ReactAppboy.logCustomEvent('reactCustomEvent', {'p1': 'p2'});
ReactAppboy.logCustomEvent(this.state.customEventText, {'p1': 'p2'});
}
_logPurchasePress(event) {
ReactAppboy.logPurchase('reactProductIdentifier', '1.2', 'USD', 2, {'pp1': 'pp2'});
Expand Down Expand Up @@ -275,15 +281,18 @@ const styles = StyleSheet.create({
alignItems: 'center',
backgroundColor: '#F5FCFF'
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10
textInput: {
height: 40,
width: 150,
borderColor: 'gray',
borderWidth: .5,
paddingLeft: 5,
marginLeft: 5,
fontSize: 14
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5
row: {
flexDirection: 'row',
alignItems: 'center'
}
});

Expand Down
53 changes: 26 additions & 27 deletions AppboyProject/android/app/BUCK
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
Expand All @@ -11,56 +9,57 @@ import re
#

lib_deps = []

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

android_library(
name = 'all-libs',
exported_deps = lib_deps
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = 'app-code',
srcs = glob([
'src/main/java/**/*.java',
]),
deps = [
':all-libs',
':build_config',
':res',
],
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = 'build_config',
package = 'com.appboyproject',
name = "build_config",
package = "com.appboyproject",
)

android_resource(
name = 'res',
res = 'src/main/res',
package = 'com.appboyproject',
name = "res",
package = "com.appboyproject",
res = "src/main/res",
)

android_binary(
name = 'app',
package_type = 'debug',
manifest = 'src/main/AndroidManifest.xml',
keystore = '//android/keystores:debug',
deps = [
':app-code',
],
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
9 changes: 8 additions & 1 deletion AppboyProject/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand All @@ -58,7 +65,7 @@ import com.android.build.OutputFile
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
Expand Down
4 changes: 4 additions & 0 deletions AppboyProject/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@

-dontwarn com.facebook.react.**

# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout

# okhttp

-keepattributes Signature
Expand Down
3 changes: 2 additions & 1 deletion AppboyProject/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.appboyproject;

import com.appboy.AppboyLifecycleCallbackListener;
import com.appboy.support.AppboyLogger;

import android.app.Application;
import android.util.Log;

import com.appboy.AppboyLifecycleCallbackListener;
import com.appboy.reactbridge.AppboyReactPackage;

import com.appboy.support.AppboyLogger;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
Expand Down Expand Up @@ -43,6 +40,6 @@ public ReactNativeHost getReactNativeHost() {
public void onCreate() {
super.onCreate();
registerActivityLifecycleCallbacks(new AppboyLifecycleCallbackListener());
AppboyLogger.LogLevel = Log.VERBOSE;
AppboyLogger.setLogLevel(Log.VERBOSE);
}
}
3 changes: 2 additions & 1 deletion AppboyProject/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
maven { url "http://appboy.github.io/appboy-android-sdk/sdk" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -19,5 +19,6 @@ allprojects {
jcenter()
maven { url "$rootDir/../node_modules/react-native/android" }
maven { url "http://appboy.github.io/appboy-android-sdk/sdk" }
maven { url "https://maven.google.com" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
12 changes: 6 additions & 6 deletions AppboyProject/android/keystores/BUCK
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
keystore(
name = 'debug',
store = 'debug.keystore',
properties = 'debug.keystore.properties',
visibility = [
'PUBLIC',
],
name = "debug",
properties = "debug.keystore.properties",
store = "debug.keystore",
visibility = [
"PUBLIC",
],
)
Loading

0 comments on commit d41fc03

Please sign in to comment.