Compare commits
No commits in common. "cb5fac940b637f7870c65fc4d47865877ffdd776" and "8a1f0d110b6a266f3f61b3538e0b21d5af77f72d" have entirely different histories.
cb5fac940b
...
8a1f0d110b
10 changed files with 21 additions and 83 deletions
2
App.js
2
App.js
|
|
@ -17,7 +17,6 @@ import ConnectionManager from "./src/managers/ConnectionManager";
|
||||||
import URLHandler from "./src/utils/URLHandler";
|
import URLHandler from "./src/utils/URLHandler";
|
||||||
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
import {setSafeBounceHeight} from "react-navigation-collapsible";
|
||||||
import {enableScreens} from 'react-native-screens';
|
import {enableScreens} from 'react-native-screens';
|
||||||
import SplashScreen from 'react-native-splash-screen'
|
|
||||||
|
|
||||||
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
// Native optimizations https://reactnavigation.org/docs/react-native-screens
|
||||||
enableScreens(true);
|
enableScreens(true);
|
||||||
|
|
@ -176,7 +175,6 @@ export default class App extends React.Component<Props, State> {
|
||||||
showUpdate: this.storageManager.preferences.updateNumber.current !== Update.number.toString(),
|
showUpdate: this.storageManager.preferences.updateNumber.current !== Update.number.toString(),
|
||||||
showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && this.storageManager.preferences.showAprilFoolsStart.current === '1',
|
showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && this.storageManager.preferences.showAprilFoolsStart.current === '1',
|
||||||
});
|
});
|
||||||
SplashScreen.hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package fr.amicaleinsat.application;
|
package fr.amicaleinsat.application;
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import com.facebook.react.ReactActivity;
|
import com.facebook.react.ReactActivity;
|
||||||
import com.facebook.react.ReactActivityDelegate;
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
import com.facebook.react.ReactRootView;
|
import com.facebook.react.ReactRootView;
|
||||||
|
|
@ -8,8 +7,6 @@ import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
|
|
||||||
import org.devio.rn.splashscreen.SplashScreen;
|
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends ReactActivity {
|
||||||
|
|
||||||
// Added automatically by Expo Config
|
// Added automatically by Expo Config
|
||||||
|
|
@ -21,11 +18,6 @@ public class MainActivity extends ReactActivity {
|
||||||
sendBroadcast(intent);
|
sendBroadcast(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
SplashScreen.show(this);
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the main component registered from JavaScript.
|
* Returns the name of the main component registered from JavaScript.
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ public class BasePackageList {
|
||||||
new expo.modules.permissions.PermissionsPackage(),
|
new expo.modules.permissions.PermissionsPackage(),
|
||||||
new expo.modules.securestore.SecureStorePackage(),
|
new expo.modules.securestore.SecureStorePackage(),
|
||||||
new expo.modules.sqlite.SQLitePackage(),
|
new expo.modules.sqlite.SQLitePackage(),
|
||||||
|
new expo.modules.updates.UpdatesPackage(),
|
||||||
new expo.modules.webbrowser.WebBrowserPackage()
|
new expo.modules.webbrowser.WebBrowserPackage()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 147 KiB |
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/colorPrimary"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:src="@drawable/launch_screen" />
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
@ -4,5 +4,4 @@
|
||||||
<color name="navigationBarColor">#121212</color>
|
<color name="navigationBarColor">#121212</color>
|
||||||
<color name="colorPrimaryDark">#be1522</color>
|
<color name="colorPrimaryDark">#be1522</color>
|
||||||
<color name="colorPrimary">#be1522</color>
|
<color name="colorPrimary">#be1522</color>
|
||||||
<color name="primary_dark">#be1522</color>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -14,20 +14,10 @@
|
||||||
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
|
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
|
||||||
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
|
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
|
||||||
|
|
||||||
#import <React/RCTLinkingManager.h>
|
|
||||||
|
|
||||||
@implementation AppDelegate
|
@implementation AppDelegate
|
||||||
|
|
||||||
@synthesize window = _window;
|
@synthesize window = _window;
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application
|
|
||||||
openURL:(NSURL *)url
|
|
||||||
options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
|
|
||||||
{
|
|
||||||
return [RCTLinkingManager application:application openURL:url options:options];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
{
|
{
|
||||||
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
|
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
|
||||||
|
|
|
||||||
|
|
@ -43,5 +43,4 @@ target 'Campus' do
|
||||||
|
|
||||||
# react-native-cli autolinking
|
# react-native-cli autolinking
|
||||||
use_native_modules!
|
use_native_modules!
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
19
package.json
19
package.json
|
|
@ -18,13 +18,21 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"expo": "^37.0.0",
|
||||||
|
"react": "~16.9.0",
|
||||||
|
"react-dom": "16.9.0",
|
||||||
|
"react-native": "~0.61.5",
|
||||||
|
"react-native-gesture-handler": "~1.6.0",
|
||||||
|
"react-native-reanimated": "~1.7.0",
|
||||||
|
"react-native-screens": "~2.2.0",
|
||||||
|
"react-native-unimodules": "~0.9.0",
|
||||||
|
"react-native-web": "~0.11.7",
|
||||||
"@expo/vector-icons": "^10.0.0",
|
"@expo/vector-icons": "^10.0.0",
|
||||||
"@react-native-community/masked-view": "0.1.6",
|
"@react-native-community/masked-view": "0.1.6",
|
||||||
"@react-navigation/bottom-tabs": "^5.1.1",
|
"@react-navigation/bottom-tabs": "^5.1.1",
|
||||||
"@react-navigation/drawer": "^5.1.1",
|
"@react-navigation/drawer": "^5.1.1",
|
||||||
"@react-navigation/native": "^5.0.9",
|
"@react-navigation/native": "^5.0.9",
|
||||||
"@react-navigation/stack": "^5.1.1",
|
"@react-navigation/stack": "^5.1.1",
|
||||||
"expo": "^37.0.0",
|
|
||||||
"expo-barcode-scanner": "~8.1.0",
|
"expo-barcode-scanner": "~8.1.0",
|
||||||
"expo-camera": "latest",
|
"expo-camera": "latest",
|
||||||
"expo-linear-gradient": "~8.1.0",
|
"expo-linear-gradient": "~8.1.0",
|
||||||
|
|
@ -32,26 +40,17 @@
|
||||||
"expo-permissions": "~8.1.0",
|
"expo-permissions": "~8.1.0",
|
||||||
"expo-secure-store": "~8.1.0",
|
"expo-secure-store": "~8.1.0",
|
||||||
"i18n-js": "^3.3.0",
|
"i18n-js": "^3.3.0",
|
||||||
"react": "~16.9.0",
|
|
||||||
"react-dom": "16.9.0",
|
|
||||||
"react-native": "~0.61.5",
|
|
||||||
"react-native-animatable": "^1.3.3",
|
"react-native-animatable": "^1.3.3",
|
||||||
"react-native-app-intro-slider": "^4.0.0",
|
"react-native-app-intro-slider": "^4.0.0",
|
||||||
"react-native-appearance": "~0.3.3",
|
"react-native-appearance": "~0.3.3",
|
||||||
"react-native-autolink": "^3.0.0",
|
"react-native-autolink": "^3.0.0",
|
||||||
"react-native-calendars": "^1.260.0",
|
"react-native-calendars": "^1.260.0",
|
||||||
"react-native-collapsible": "^1.5.2",
|
"react-native-collapsible": "^1.5.2",
|
||||||
"react-native-gesture-handler": "~1.6.0",
|
|
||||||
"react-native-image-modal": "^1.0.6",
|
"react-native-image-modal": "^1.0.6",
|
||||||
"react-native-modalize": "^1.3.6",
|
"react-native-modalize": "^1.3.6",
|
||||||
"react-native-paper": "^3.8.0",
|
"react-native-paper": "^3.8.0",
|
||||||
"react-native-reanimated": "~1.7.0",
|
|
||||||
"react-native-render-html": "^4.1.2",
|
"react-native-render-html": "^4.1.2",
|
||||||
"react-native-safe-area-context": "0.7.3",
|
"react-native-safe-area-context": "0.7.3",
|
||||||
"react-native-screens": "~2.2.0",
|
|
||||||
"react-native-splash-screen": "^3.2.0",
|
|
||||||
"react-native-unimodules": "~0.9.0",
|
|
||||||
"react-native-web": "~0.11.7",
|
|
||||||
"react-native-webview": "8.1.1",
|
"react-native-webview": "8.1.1",
|
||||||
"react-navigation-collapsible": "^5.5.0",
|
"react-navigation-collapsible": "^5.5.0",
|
||||||
"react-navigation-header-buttons": "^3.0.5"
|
"react-navigation-header-buttons": "^3.0.5"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,9 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import {Linking} from 'react-native';
|
import {Linking} from 'expo';
|
||||||
|
|
||||||
export default class URLHandler {
|
export default class URLHandler {
|
||||||
|
|
||||||
static SCHEME = "campus-insat://";
|
|
||||||
|
|
||||||
static CLUB_INFO_URL_PATH = "club";
|
static CLUB_INFO_URL_PATH = "club";
|
||||||
static EVENT_INFO_URL_PATH = "event";
|
static EVENT_INFO_URL_PATH = "event";
|
||||||
|
|
||||||
|
|
@ -22,47 +20,21 @@ export default class URLHandler {
|
||||||
|
|
||||||
listen() {
|
listen() {
|
||||||
Linking.addEventListener('url', this.onUrl);
|
Linking.addEventListener('url', this.onUrl);
|
||||||
Linking.getInitialURL().then(this.onInitialUrl);
|
Linking.parseInitialURLAsync().then(this.onInitialUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
onUrl = ({url}: { url: string }) => {
|
onUrl = ({url}: Object) => {
|
||||||
if (url != null) {
|
let data = URLHandler.getUrlData(Linking.parse(url));
|
||||||
let data = URLHandler.getUrlData(URLHandler.parseUrl(url));
|
if (data !== null)
|
||||||
if (data !== null)
|
this.onDetectURL(data);
|
||||||
this.onDetectURL(data);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onInitialUrl = (url: ?string) => {
|
onInitialUrl = ({path, queryParams}: Object) => {
|
||||||
if (url != null) {
|
let data = URLHandler.getUrlData({path, queryParams});
|
||||||
let data = URLHandler.getUrlData(URLHandler.parseUrl(url));
|
if (data !== null)
|
||||||
if (data !== null)
|
this.onInitialURLParsed(data);
|
||||||
this.onInitialURLParsed(data);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static parseUrl(url: string) {
|
|
||||||
let params = {};
|
|
||||||
let path = "";
|
|
||||||
let temp = url.replace(URLHandler.SCHEME, "");
|
|
||||||
if (temp != null) {
|
|
||||||
let array = temp.split("?");
|
|
||||||
if (array != null && array.length > 0) {
|
|
||||||
path = array[0];
|
|
||||||
}
|
|
||||||
if (array != null && array.length > 1) {
|
|
||||||
let tempParams = array[1].split("&");
|
|
||||||
for (let i = 0; i < tempParams.length; i++) {
|
|
||||||
let paramsArray = tempParams[i].split("=");
|
|
||||||
if (paramsArray.length > 1) {
|
|
||||||
params[paramsArray[0]] = paramsArray[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {path: path, queryParams: params};
|
|
||||||
}
|
|
||||||
|
|
||||||
static getUrlData({path, queryParams}: Object) {
|
static getUrlData({path, queryParams}: Object) {
|
||||||
let data = null;
|
let data = null;
|
||||||
if (path !== null) {
|
if (path !== null) {
|
||||||
|
|
@ -75,7 +47,7 @@ export default class URLHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
static isUrlValid(url: string) {
|
static isUrlValid(url: string) {
|
||||||
return this.getUrlData(URLHandler.parseUrl(url)) !== null;
|
return this.getUrlData(Linking.parse(url)) !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
static isClubInformationLink(path: string) {
|
static isClubInformationLink(path: string) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue