Skip to content

Commit

Permalink
fix "Get app state" dubug menu in Android
Browse files Browse the repository at this point in the history
  • Loading branch information
TETRA2000 authored and frantic committed Apr 26, 2016
1 parent b868731 commit 4a02254
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ dependencies {
compile project(':react-native-push-notification')
compile project(':react-native-share')
compile project(':react-native-fbsdk')
compile project(':react-native-send-intent')
}
3 changes: 3 additions & 0 deletions android/app/src/main/java/com/facebook/f8/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

import cl.json.RNSharePackage;

import com.burnweb.rnsendintent.RNSendIntentPackage;

public class MainActivity extends ReactActivity {
private CodePush _codePush;
private ReactNativePushNotificationPackage _pushNotification;
Expand Down Expand Up @@ -92,6 +94,7 @@ protected List<ReactPackage> getPackages() {
new FBSDKPackage(mCallbackManager),
new LinearGradientPackage(),
new RNSharePackage(),
new RNSendIntentPackage(),
this._codePush.getReactPackage(),
this._pushNotification
);
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ include ':app', ':react-native-code-push'
include ':react-native-push-notification'
include ':react-native-share', ':app'
include ':react-native-fbsdk'
include ':react-native-send-intent', ':app'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/RNPushNotificationAndroid')
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
project(':react-native-fbsdk').projectDir = new File(settingsDir, '../node_modules/react-native-fbsdk/Android')
project(':react-native-send-intent').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-send-intent')
20 changes: 16 additions & 4 deletions js/actions/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

const Parse = require('parse/react-native');
const ActionSheetIOS = require('ActionSheetIOS');
const Platform = require('Platform');
const {version} = require('../env');
const SendIntentAndroid = Platform.OS === 'android' ? require('react-native-send-intent') : undefined;

import type { Action, ThunkAction } from './types';

Expand Down Expand Up @@ -54,10 +56,20 @@ function testResetNuxes(): Action {

function testExportAppState(): ThunkAction {
return (dispatch, getState) => {
ActionSheetIOS.showShareActionSheetWithOptions({
subject: `App v${version} state`,
message: JSON.stringify(getState(), undefined, 2),
}, () => {}, () => {});
const subject = `App v${version} state`;
const message = JSON.stringify(getState(), undefined, 2);
if (Platform.OS === 'ios') {
ActionSheetIOS.showShareActionSheetWithOptions({
subject: subject,
message: message,
}, () => {}, () => {});
} else {
SendIntentAndroid.sendText({
title: subject,
text: message,
type: SendIntentAndroid.TEXT_PLAIN
});
}
};
}

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"react-native-fbsdk": "github:facebook/react-native-fbsdk#0.1.0-alpha.1",
"react-native-linear-gradient": "~1.5.0",
"react-native-push-notification": "frantic/react-native-push-notification#7142da7",
"react-native-send-intent": "^1.0.7",
"react-native-share": "frantic/react-native-share#674df947b3",
"react-redux": "~4.3.0",
"react-relay": "~0.7.3",
Expand Down

0 comments on commit 4a02254

Please sign in to comment.