Skip to content

Commit

Permalink
Upgrade example to 0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
kraffslol committed Jun 27, 2016
1 parent dfc63f0 commit 12f845e
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 98 deletions.
70 changes: 7 additions & 63 deletions example/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,71 +1,13 @@
[ignore]

# We fork some components by platform.
.*/*.web.js
.*/*.android.js

# Some modules have their own node_modules with overlap
.*/node_modules/node-haste/.*

# Ugh
.*/node_modules/babel.*
.*/node_modules/babylon.*
.*/node_modules/invariant.*

# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/ErrorUtils.js

# Flow has a built-in definition for the 'react' module which we prefer to use
# over the currently-untyped source
.*/node_modules/react/react.js
.*/node_modules/react/lib/React.js
.*/node_modules/react/lib/ReactDOM.js

.*/__mocks__/.*
.*/__tests__/.*

.*/commoner/test/source/widget/share.js

# Ignore commoner tests
.*/node_modules/commoner/test/.*

# See https://github.com/facebook/flow/issues/442
.*/react-tools/node_modules/commoner/lib/reader.js

# Ignore jest
.*/node_modules/jest-cli/.*

# Ignore Website
.*/website/.*

# Ignore generators
# Ignore templates with `@flow` in header
.*/local-cli/generator.*

# Ignore BUCK generated folders
.*\.buckd/

# Ignore RNPM
.*/local-cli/rnpm/.*

.*/node_modules/is-my-json-valid/test/.*\.json
.*/node_modules/iconv-lite/encodings/tables/.*\.json
# Ignore malformed json
.*/node_modules/y18n/test/.*\.json
.*/node_modules/spdx-license-ids/spdx-license-ids.json
.*/node_modules/spdx-exceptions/index.json
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
.*/node_modules/resolve/lib/core.json
.*/node_modules/jsonparse/samplejson/.*\.json
.*/node_modules/json5/test/.*\.json
.*/node_modules/ua-parser-js/test/.*\.json
.*/node_modules/builtin-modules/builtin-modules.json
.*/node_modules/binary-extensions/binary-extensions.json
.*/node_modules/url-regex/tlds.json
.*/node_modules/joi/.*\.json
.*/node_modules/isemail/.*\.json
.*/node_modules/tr46/.*\.json


[include]

Expand All @@ -80,6 +22,8 @@ module.system=haste
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable

experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
Expand All @@ -89,9 +33,9 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

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

[version]
^0.25.0
^0.27.0
1 change: 1 addition & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ project.xcworkspace

# Android/IJ
#
*.iml
.idea
.gradle
local.properties
Expand Down
3 changes: 3 additions & 0 deletions example/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
Expand Down
32 changes: 0 additions & 32 deletions example/android/app/src/main/java/com/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import java.util.Arrays;
import java.util.List;

import com.pw.droplet.braintree.BraintreePackage;
import android.content.Intent;

public class MainActivity extends ReactActivity {
private BraintreePackage mBraintreePackage;
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
Expand All @@ -20,32 +16,4 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() {
return "example";
}

/**
* Returns whether dev mode should be enabled.
* This enables e.g. the dev menu.
*/
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
mBraintreePackage = new BraintreePackage(this)
);
}

@Override
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
super.onActivityResult(requestCode, resultCode, data);

mBraintreePackage.handleActivityResult(requestCode, resultCode, data);
}
}
39 changes: 39 additions & 0 deletions example/android/app/src/main/java/com/example/MainApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.example;

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

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;

import java.util.Arrays;
import java.util.List;

import android.content.Intent;
import com.pw.droplet.braintree.BraintreePackage;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new BraintreePackage()
);
}
};

@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
4 changes: 3 additions & 1 deletion example/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ class example extends Component {
const token = "eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiI5YzRiYWQxMmEzNzc1ZmRjNDJjMmJiMzkwMWQ4ODhlODQwZTkzZDYxYzgyOTgyYjU1MDBlZDNhYzUzZWRkMjM5fGNyZWF0ZWRfYXQ9MjAxNi0wNi0xOFQxNDoyMjo1MS43Mzc1OTcwMjcrMDAwMFx1MDAyNm1lcmNoYW50X2lkPWNjOWY2OHZ3Y2NrdDYzdGpcdTAwMjZwdWJsaWNfa2V5PW0ycGJ4a3F4Yzl5ZHQyYzIiLCJjb25maWdVcmwiOiJodHRwczovL2FwaS5zYW5kYm94LmJyYWludHJlZWdhdGV3YXkuY29tOjQ0My9tZXJjaGFudHMvY2M5ZjY4dndjY2t0NjN0ai9jbGllbnRfYXBpL3YxL2NvbmZpZ3VyYXRpb24iLCJjaGFsbGVuZ2VzIjpbXSwiZW52aXJvbm1lbnQiOiJzYW5kYm94IiwiY2xpZW50QXBpVXJsIjoiaHR0cHM6Ly9hcGkuc2FuZGJveC5icmFpbnRyZWVnYXRld2F5L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CI6ImNjOWY2OHZ3Y2NrdDYzdGoiLCJ2ZW5tbyI6Im9mZiJ9";
BTClient.setup(token)
.then(function(success) {
console.log('success')
console.log(success)
// BTClient.getCardNonce("4111111111111111", "10", "20").then(function(nonce) {console.log(nonce)}).catch(function(err) {console.log('error')})
})
.catch(function(err) {console.log(err)});
BTClient.showPaymentViewController()
.then(function(nonce) {
//payment succeeded, pass nonce to server
console.log(nonce)
})
.catch(function(err) {
//error handling
console.log(error)
});
}

Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react": "^15.1.0",
"react-native": "0.27.2",
"react": "15.2.0-rc.1",
"react-native": "0.29.0-rc.0",
"react-native-braintree-xplat": "file:../"
}
}

0 comments on commit 12f845e

Please sign in to comment.