Skip to content

Commit

Permalink
Merge pull request #84 from jiloysss/master
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
jiloysss authored Dec 12, 2019
2 parents 0586a48 + 4987853 commit f4aa9ef
Show file tree
Hide file tree
Showing 68 changed files with 3,282 additions and 1,452 deletions.
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ android {
}

dependencies {
compile project(':react-native-nfc-manager')
compile project(':react-native-key-event')
compile project(':react-native-localization')
compile project(':react-native-background-job')
compile project(':react-native-bluetooth-status')
Expand Down
19 changes: 17 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
Expand All @@ -21,15 +22,29 @@
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="landscape">
android:screenOrientation="landscape"
android:launchMode="singleTask">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>

<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/nfc_tech_filter" />
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyC1F5BFOEvWeBv67pvGWzjMCFItmi851yg"/>

<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>

Expand Down
19 changes: 18 additions & 1 deletion android/app/src/main/java/com/tailpos/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.tailpos;

import android.os.Bundle;

import android.view.KeyEvent; // <--- import
import net.kangyufei.KeyEventModule; // <--- import
import org.devio.rn.splashscreen.SplashScreen;
import com.facebook.react.ReactActivity;

Expand All @@ -22,4 +23,20 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

@Override // <--- Add this method if you want to react to keyDown
public boolean onKeyDown(int keyCode, KeyEvent event) {

KeyEventModule.getInstance().onKeyDownEvent(keyCode, event);
super.onKeyDown(keyCode, event);
return true;
}

@Override // <--- Add this method if you want to react to keyUp
public boolean onKeyUp(int keyCode, KeyEvent event) {
KeyEventModule.getInstance().onKeyUpEvent(keyCode, event);

super.onKeyUp(keyCode, event);
return true;
}

}
4 changes: 4 additions & 0 deletions android/app/src/main/java/com/tailpos/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import com.solinor.bluetoothstatus.RNBluetoothManagerPackage;
import com.facebook.react.ReactApplication;
import community.revteltech.nfc.NfcManagerPackage;
import net.kangyufei.KeyEventPackage;
import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage;
import com.pilloxa.backgroundjob.BackgroundJobPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
Expand Down Expand Up @@ -37,6 +39,8 @@ protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new RNBluetoothManagerPackage(),
new MainReactPackage(),
new NfcManagerPackage(),
new KeyEventPackage(),
new ReactNativeLocalizationPackage(),
new BackgroundJobPackage(),
new RNDeviceInfo(),
Expand Down
29 changes: 29 additions & 0 deletions android/app/src/main/res/xml/nfc_tech_filter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcB</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcF</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcV</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.Ndef</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NdefFormatable</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.MifareClassic</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
</resources>
4 changes: 4 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
rootProject.name = 'TailPOS'
include ':react-native-nfc-manager'
project(':react-native-nfc-manager').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-nfc-manager/android')
include ':react-native-key-event'
project(':react-native-key-event').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-key-event/android')
include ':react-native-localization'
project(':react-native-localization').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-localization/android')
include ':react-native-background-job'
Expand Down
29 changes: 29 additions & 0 deletions android/src/main/res/xml/nfc_tech_filter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcA</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcB</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcF</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NfcV</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.Ndef</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.NdefFormatable</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.MifareClassic</tech>
</tech-list>
<tech-list>
<tech>android.nfc.tech.MifareUltralight</tech>
</tech-list>
</resources>
42 changes: 42 additions & 0 deletions changes/nfc-manager-build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
apply plugin: 'com.android.library'

android {
compileSdkVersion safeExtGet('compileSdkVersion', 27)
buildToolsVersion safeExtGet('buildToolsVersion', '27.0.3')

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
//noinspection OldTargetApi
targetSdkVersion safeExtGet('targetSdkVersion', 27)
}
lintOptions {
abortOnError false
}
}

repositories {
mavenCentral()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}


dependencies {
compile 'com.facebook.react:react-native:+'

}
19 changes: 19 additions & 0 deletions ios/TailPOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
43FFBF74D0094DD8866DD727 /* libRNBluetoothManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 114C3F4566DC4AAFBF009FFF /* libRNBluetoothManager.a */; };
51F0F7BBE5C142D4B8521808 /* libRNBackgroundJob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 030627CBACC14D929C0207BD /* libRNBackgroundJob.a */; };
520D4F11F21A4CEEB05724EB /* libReactNativeLocalization.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A5548395195745ED8AFFDEBB /* libReactNativeLocalization.a */; };
6BEB5BDCB20043EA80E560C6 /* libNfcManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D806BF8811F4260B10899D2 /* libNfcManager.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -413,6 +414,8 @@
030627CBACC14D929C0207BD /* libRNBackgroundJob.a */ = {isa = PBXFileReference; name = "libRNBackgroundJob.a"; path = "libRNBackgroundJob.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
D5BF8BC30E324943AB843FEB /* ReactNativeLocalization.xcodeproj */ = {isa = PBXFileReference; name = "ReactNativeLocalization.xcodeproj"; path = "../node_modules/react-native-localization/ReactNativeLocalization.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
A5548395195745ED8AFFDEBB /* libReactNativeLocalization.a */ = {isa = PBXFileReference; name = "libReactNativeLocalization.a"; path = "libReactNativeLocalization.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
2C27E3CBAD07414F89BF7DAE /* NfcManager.xcodeproj */ = {isa = PBXFileReference; name = "NfcManager.xcodeproj"; path = "../node_modules/react-native-nfc-manager/ios/NfcManager.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
2D806BF8811F4260B10899D2 /* libNfcManager.a */ = {isa = PBXFileReference; name = "libNfcManager.a"; path = "libNfcManager.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -455,6 +458,7 @@
43FFBF74D0094DD8866DD727 /* libRNBluetoothManager.a in Frameworks */,
51F0F7BBE5C142D4B8521808 /* libRNBackgroundJob.a in Frameworks */,
520D4F11F21A4CEEB05724EB /* libReactNativeLocalization.a in Frameworks */,
6BEB5BDCB20043EA80E560C6 /* libNfcManager.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -657,6 +661,7 @@
0FC20227933C497CB2330EEF /* RNBluetoothManager.xcodeproj */,
2140AF7DBD7F486D8BC7E6D1 /* RNBackgroundJob.xcodeproj */,
D5BF8BC30E324943AB843FEB /* ReactNativeLocalization.xcodeproj */,
2C27E3CBAD07414F89BF7DAE /* NfcManager.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
Expand Down Expand Up @@ -1320,6 +1325,7 @@
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TailPOS.app/TailPOS";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1336,6 +1342,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Debug;
Expand All @@ -1356,6 +1363,7 @@
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TailPOS.app/TailPOS";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1372,6 +1380,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Release;
Expand Down Expand Up @@ -1406,6 +1415,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Debug;
Expand Down Expand Up @@ -1439,6 +1449,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Release;
Expand Down Expand Up @@ -1468,6 +1479,7 @@
TVOS_DEPLOYMENT_TARGET = 9.2;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1484,6 +1496,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Debug;
Expand Down Expand Up @@ -1513,6 +1526,7 @@
TVOS_DEPLOYMENT_TARGET = 9.2;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1529,6 +1543,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Release;
Expand Down Expand Up @@ -1557,6 +1572,7 @@
TVOS_DEPLOYMENT_TARGET = 10.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1573,6 +1589,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Debug;
Expand Down Expand Up @@ -1601,6 +1618,7 @@
TVOS_DEPLOYMENT_TARGET = 10.1;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -1617,6 +1635,7 @@
"$(SRCROOT)/../node_modules/react-native-bluetooth-status/ios",
"$(SRCROOT)/../node_modules/react-native-background-job/ios",
"$(SRCROOT)/../node_modules/react-native-localization",
"$(SRCROOT)/../node_modules/react-native-nfc-manager/ios",
);
};
name = Release;
Expand Down
Loading

0 comments on commit f4aa9ef

Please sign in to comment.