Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/0.0.21 #64

Open
wants to merge 65 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
4c7539e
下载modal
Aug 12, 2021
8c4d961
link
Aug 12, 2021
f7181d1
link
Aug 12, 2021
47035ee
merge
tianlu1677 Aug 12, 2021
35a35f5
use xupdate
tianlu1677 Aug 13, 2021
9001927
try fixed
tianlu1677 Aug 14, 2021
f36f9fd
add android
tianlu1677 Aug 14, 2021
c0fdbac
fixed
tianlu1677 Aug 14, 2021
1a69053
update android
tianlu1677 Aug 14, 2021
78e2334
fixed
tianlu1677 Aug 15, 2021
18b2137
fixed
tianlu1677 Aug 15, 2021
391c62b
跳过
Aug 15, 2021
eb927a7
update version
tianlu1677 Aug 17, 2021
1c67c67
hide flipper on ios
tianlu1677 Aug 20, 2021
b01abc7
tabbar
Aug 20, 2021
952d20f
社区
Aug 23, 2021
17de1c0
update
Aug 23, 2021
6eb60d6
console
Aug 23, 2021
18356b4
update
Aug 23, 2021
66b343a
add share model
tianlu1677 Aug 24, 2021
770bf51
main tab unread count
tianlu1677 Aug 24, 2021
83f3509
remove notice
tianlu1677 Aug 24, 2021
f00f309
update
Aug 24, 2021
1b40871
load
Aug 24, 2021
f9a1e5a
message
Aug 24, 2021
2964082
add dev tools
tianlu1677 Aug 24, 2021
79ef92e
Merge branch 'feature/0.0.21' of github.com:tianlu1677/wanya_native i…
tianlu1677 Aug 24, 2021
96b9558
评论
Aug 25, 2021
c222245
add statis
tianlu1677 Aug 25, 2021
0b22749
remove code
tianlu1677 Aug 25, 2021
4040188
Merge branch 'feature/0.0.21' of github.com:tianlu1677/wanya_native i…
tianlu1677 Aug 25, 2021
c7e09b6
fixed view
tianlu1677 Aug 25, 2021
f9dbf51
add discovery
tianlu1677 Aug 25, 2021
8877be1
@
Aug 27, 2021
d5e2cf9
fix
Aug 27, 2021
80e1606
add statis
tianlu1677 Aug 27, 2021
18f70e5
fixed view
tianlu1677 Aug 27, 2021
3280fb1
fixed category name
tianlu1677 Aug 27, 2021
f36b407
fix
Aug 28, 2021
46e3d75
fixed view
tianlu1677 Aug 29, 2021
1e1ea9b
change main tab
tianlu1677 Aug 29, 2021
a0adef9
fixed view
tianlu1677 Aug 29, 2021
df43eb6
style
Aug 29, 2021
7c24ab8
recommend init
tianlu1677 Aug 29, 2021
1ab7602
fixed
tianlu1677 Aug 29, 2021
fcead0d
update
tianlu1677 Aug 29, 2021
ed077ed
load
Aug 29, 2021
45f0ac6
tab style
Aug 30, 2021
bc9df40
style
Aug 30, 2021
e4b11d7
fix
Aug 30, 2021
a4e4d1d
utils
Aug 30, 2021
5d8339f
fix
Aug 30, 2021
cf4dcee
fixed
tianlu1677 Aug 31, 2021
5ec97ac
change group
tianlu1677 Aug 31, 2021
7459337
Merge branch 'feature/0.0.21' of github.com:tianlu1677/wanya_native i…
tianlu1677 Aug 31, 2021
f7da3eb
change jump
tianlu1677 Aug 31, 2021
b75aed2
fixed
tianlu1677 Aug 31, 2021
83c0d36
fixed dup
tianlu1677 Aug 31, 2021
177953b
fixed
tianlu1677 Aug 31, 2021
c93fc54
label line
Aug 31, 2021
d2392d8
fixed
tianlu1677 Sep 1, 2021
e5dec26
fixed
tianlu1677 Sep 3, 2021
fb8e01d
fixed view
tianlu1677 Sep 5, 2021
717135d
fixed main
tianlu1677 Sep 5, 2021
e7c7b87
base node
tianlu1677 Sep 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ import {init, Geolocation} from 'react-native-amap-geolocation';
import * as RootNavigation from '@/navigator/root-navigation';
import * as action from '@/redux/constants';
import {getChannels, getChannelPosts} from '@/api/home_api';
import { BasePosthogKey} from "@/utils/config"
import JPush from 'jpush-react-native';
WeChat.registerApp('wx17b69998e914b8f0', 'https://app.meirixinxue.com/');
import JVerification from 'jverification-react-native';
import { RootSiblingParent } from 'react-native-root-siblings';
import {RootSiblingParent} from 'react-native-root-siblings';
import CommentInput from '@/components/comment-input';

const queryString = require('query-string');
const codePushOptions = {
Expand Down Expand Up @@ -62,6 +64,18 @@ class App extends Component {
scale = 1.08;
}

Text.defaultProps = Object.assign({}, Text.defaultProps, {
allowFontScaling: false,
adjustsFontSizeToFit: true,
minimumFontScale: scale,
});
Text.defaultProps.sytle = {color: 'black'};
TextInput.defaultProps = Object.assign({}, TextInput.defaultProps, {
defaultProps: false,
allowFontScaling: false,
textBreakStrategy: 'simple',
});

this.loadSplashImg();
this.loadSettings();
this.checkPermission();
Expand All @@ -75,19 +89,7 @@ class App extends Component {

// this.saveToken(); //保存token

// console.log('scale', scale);

Text.defaultProps = Object.assign({}, Text.defaultProps, {
allowFontScaling: false,
adjustsFontSizeToFit: true,
minimumFontScale: scale,
});
Text.defaultProps.sytle = {color: 'black'};
TextInput.defaultProps = Object.assign({}, TextInput.defaultProps, {
defaultProps: false,
allowFontScaling: false,
textBreakStrategy: 'simple',
});
}

loadSplashImg = () => {
Expand All @@ -114,8 +116,8 @@ class App extends Component {
};
JVerification.init(initParams, result => {
console.log('JVerification init', result);
})
}
});
};

checkPermission = () => {
checkMultiple([PERMISSIONS.IOS.LOCATION_WHEN_IN_USE]).then(statuses => {
Expand Down Expand Up @@ -249,6 +251,8 @@ class App extends Component {
<ImagePreview />
<ShareMultiModal />
<ModalPortal />

<CommentInput navigation={RootNavigation} />
</PersistGate>
</Provider>
</RootSiblingParent>
Expand Down
8 changes: 8 additions & 0 deletions ReactotronConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Reactotron from 'reactotron-react-native'
import AsyncStorage from '@react-native-community/async-storage';

Reactotron
.setAsyncStorageHandler(AsyncStorage) // AsyncStorage would either come from `react-native` or `@react-native-community/async-storage` depending on where you get it from
.configure() // controls connection & communication settings
.useReactNative() // add all built-in react native plugins
.connect() // let's connect!
29 changes: 16 additions & 13 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ android {
vectorDrawables.useSupportLibrary = true
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 11
versionName "0.0.25"
versionCode 13
versionName "0.0.27"

manifestPlaceholders = [
JPUSH_PKGNAME: applicationId,
Expand Down Expand Up @@ -236,26 +236,29 @@ dependencies {
implementation project(':lottie-react-native')

compile project(':react-native-video')
implementation "androidx.appcompat:appcompat:1.0.0"
//implementation "androidx.appcompat:appcompat:1.1.0"

implementation "com.squareup.okhttp3:okhttp:4.2.1"
implementation "com.squareup.okhttp3:logging-interceptor:4.2.1"
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.2.1"
implementation "androidx.multidex:multidex:2.0.0"
implementation 'androidx.appcompat:appcompat:1.3.0'
//implementation 'com.posthog.android:posthog:1.+'

// compile project(':push')

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
//debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
//exclude group:'com.facebook.fbjni'
//}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
//debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
// exclude group:'com.facebook.flipper'
// exclude group:'com.squareup.okhttp3', module:'okhttp'
//}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
//debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
// exclude group:'com.facebook.flipper'
//}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,72 +1,72 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.vanyah.androidnative;
// /**
// * Copyright (c) Facebook, Inc. and its affiliates.
// *
// * <p>This source code is licensed under the MIT license found in the LICENSE file in the root
// * directory of this source tree.
// */
// package com.vanyah.androidnative;

import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
// import android.content.Context;
// import com.facebook.flipper.android.AndroidFlipperClient;
// import com.facebook.flipper.android.utils.FlipperUtils;
// import com.facebook.flipper.core.FlipperClient;
// import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
// import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
// import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
// import com.facebook.flipper.plugins.inspector.DescriptorMapping;
// import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
// import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
// import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
// import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
// import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
// import com.facebook.react.ReactInstanceManager;
// import com.facebook.react.bridge.ReactContext;
// import com.facebook.react.modules.network.NetworkingModule;
// import okhttp3.OkHttpClient;

public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
// public class ReactNativeFlipper {
// public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
// if (FlipperUtils.shouldEnableFlipper(context)) {
// final FlipperClient client = AndroidFlipperClient.getInstance(context);

client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
// client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
// client.addPlugin(new ReactFlipperPlugin());
// client.addPlugin(new DatabasesFlipperPlugin(context));
// client.addPlugin(new SharedPreferencesFlipperPlugin(context));
// client.addPlugin(CrashReporterPlugin.getInstance());

NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
// NetworkingModule.setCustomClientBuilder(
// new NetworkingModule.CustomClientBuilder() {
// @Override
// public void apply(OkHttpClient.Builder builder) {
// builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
// }
// });
// client.addPlugin(networkFlipperPlugin);
// client.start();

// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
// // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// // Hence we run if after all native modules have been initialized
// ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
// if (reactContext == null) {
// reactInstanceManager.addReactInstanceEventListener(
// new ReactInstanceManager.ReactInstanceEventListener() {
// @Override
// public void onReactContextInitialized(ReactContext reactContext) {
// reactInstanceManager.removeReactInstanceEventListener(this);
// reactContext.runOnNativeModulesQueueThread(
// new Runnable() {
// @Override
// public void run() {
// client.addPlugin(new FrescoFlipperPlugin());
// }
// });
// }
// });
// } else {
// client.addPlugin(new FrescoFlipperPlugin());
// }
// }
// }
// }
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public ReactNativeHost getReactNativeHost() {
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
// initializeFlipper(this, getReactNativeHost().getReactInstanceManager());

JPushModule.registerActivityLifecycle(this);
// UMConfigure.setLogEnabled(true);
Expand All @@ -92,27 +92,27 @@ public void onCreate() {
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.vanyah.androidnative.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
// private static void initializeFlipper(
// Context context, ReactInstanceManager reactInstanceManager) {
// if (BuildConfig.DEBUG) {
// try {
// /*
// We use reflection here to pick up the class that initializes Flipper,
// since Flipper library is not available in release mode
// */
// Class<?> aClass = Class.forName("com.vanyah.androidnative.ReactNativeFlipper");
// aClass
// .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
// .invoke(null, context, reactInstanceManager);
// } catch (ClassNotFoundException e) {
// e.printStackTrace();
// } catch (NoSuchMethodException e) {
// e.printStackTrace();
// } catch (IllegalAccessException e) {
// e.printStackTrace();
// } catch (InvocationTargetException e) {
// e.printStackTrace();
// }
// }
// }
}
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ android.useAndroidX=true
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.37.0
# FLIPPER_VERSION=0.37.0
5 changes: 4 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ project(':jverification-react-native').projectDir = new File(rootProject.project
include ':jpush-react-native'
project(':jpush-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jpush-react-native/android')
include ':jcore-react-native'
project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')
project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')

//include ':posthog-react-native'
//project(':posthog-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/posthog-react-native/android')
4 changes: 2 additions & 2 deletions iconfont.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"symbol_url": "//at.alicdn.com/t/font_1446105_znjtkpzvld.js",
"symbol_url": "//at.alicdn.com/t/font_1446105_dfbygoqunkb.js",
"use_typescript": false,
"save_dir": "./src/iconfont",
"trim_icon_prefix": "icon",
"default_icon_size": 16
}
}
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
*/

// import './logbox'

if(__DEV__) {
import('./ReactotronConfig').then(() => console.log('Reactotron Configured'))
}
import 'react-native-gesture-handler';

import React, {Component} from 'react';
Expand Down
12 changes: 8 additions & 4 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ target 'wanya_native' do
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
#use_flipper!
# use_flipper!({ 'Flipper' => '0.101.0' })
# 暂时指定版本
# https://stackoverflow.com/questions/68264876/xcode-build-error-with-react-native-cxa-increment-exception-refcount
# use_flipper!({'Flipper' => '0.92.0', 'Flipper-Folly' => '2.6.7'})
# post_install do |installer|
# flipper_post_install(installer)
# end
end

target 'wanya_native-tvOS' do
Expand Down
Loading