Skip to content

Commit

Permalink
sample app updates for 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marchinram committed Jan 5, 2023
1 parent 4be7195 commit 1a8ce5e
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 13,249 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "interactive"
}
6 changes: 3 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def jscFlavor = 'org.webkit:android-jsc:+'
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
def enableHermes = project.ext.react.get("enableHermes", false)

/**
* Architectures to build native code for.
Expand Down Expand Up @@ -261,7 +261,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
Expand All @@ -285,7 +285,7 @@ dependencies {
implementation jscFlavor
}

compileOnly 'com.foursquare:pilgrimsdk:3.1.0'
compileOnly 'com.foursquare:pilgrimsdk:3.4.0'
}

if (isNewArchitectureEnabled()) {
Expand Down
14 changes: 8 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import org.apache.tools.ant.taskdefs.condition.Os

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
compileSdkVersion = 33
targetSdkVersion = 33

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
Expand All @@ -22,7 +20,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.android.tools.build:gradle:7.2.2")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -49,6 +47,10 @@ allprojects {
}
google()
maven { url 'https://www.jitpack.io' }
maven { url 'https://foursquare.jfrog.io/foursquare/libs-release/' }
maven { url 'https://foursquare.jfrog.io/foursquare/libs-release/'
content {
excludeGroup "com.facebook.react"
}
}
}
}
29 changes: 22 additions & 7 deletions app/screens/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ import {RootStackParamList} from '../App';

interface HomeState {
installId: string;
isEnabled: boolean;
}

type HomePropsProps = StackScreenProps<RootStackParamList, 'Home'>;

export default class HomeScreen extends Component<HomePropsProps, HomeState> {
state: HomeState = {
installId: '-',
isEnabled: false,
};

componentDidMount() {
this.requestLocationPermission();
this.setInstallId();
this.setIsEnabled();
}

private async requestLocationPermission() {
Expand Down Expand Up @@ -62,6 +65,19 @@ export default class HomeScreen extends Component<HomePropsProps, HomeState> {
this.setState({installId: installId});
}

private async setIsEnabled() {
const isEnabled = await PilgrimSdk.isEnabled();
this.setState({isEnabled: isEnabled});
}

private getEnabledText() {
if (this.state.isEnabled) {
return 'Yes';
} else {
return 'No';
}
}

private async fireTestVisit() {
try {
const location = await RNLocation.getLatestLocation();
Expand All @@ -82,12 +98,12 @@ export default class HomeScreen extends Component<HomePropsProps, HomeState> {

private async startPilgrim() {
PilgrimSdk.start();
Alert.alert('Pilrim SDK', 'Pilgrim started');
this.setIsEnabled();
}

private async stopPilgrim() {
PilgrimSdk.stop();
Alert.alert('Pilrim SDK', 'Pilgrim stopped');
this.setIsEnabled();
}

private async showDebugScreen() {
Expand Down Expand Up @@ -134,9 +150,8 @@ export default class HomeScreen extends Component<HomePropsProps, HomeState> {
}}
/>
<View style={styles.separator} />
<Text style={styles.installId}>
Install ID: {this.state.installId}
</Text>
<Text style={styles.footer}>Install ID: {this.state.installId}</Text>
<Text style={styles.footer}>Enabled: {this.getEnabledText()}</Text>
</ScrollView>
</>
);
Expand All @@ -148,9 +163,9 @@ const styles = StyleSheet.create({
flex: 1,
paddingTop: 20,
},
installId: {
footer: {
textAlign: 'center',
padding: 20,
padding: 10,
fontSize: 13,
color: 'black',
},
Expand Down
10 changes: 5 additions & 5 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ PODS:
- glog (0.3.5)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- Pilgrim (3.1.0)
- pilgrim-sdk-react-native (1.1.3):
- Pilgrim (= 3.1.0)
- Pilgrim (3.4.0)
- pilgrim-sdk-react-native (1.2.0):
- Pilgrim (= 3.4.0)
- React-Core
- RCT-Folly (2021.06.28.00-v2):
- boost
Expand Down Expand Up @@ -554,8 +554,8 @@ SPEC CHECKSUMS:
glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
Pilgrim: 83bfa7bb4d59b91ceb946e50dafaf338e19fcd63
pilgrim-sdk-react-native: a0d90e8a8225e6246fb127b3f41b0acaa369e777
Pilgrim: cc2a95e9c15f35989bb4833a7772499382559a87
pilgrim-sdk-react-native: e0cb5497a259d617276992a316f5a6c6d7fec2d6
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
RCTRequired: b723d4d6da2795df58189a01f92856b6912cf256
RCTTypeSafety: 3973d2fcf39f43f7819e840d56ea6b2fe45996a0
Expand Down
Loading

0 comments on commit 1a8ce5e

Please sign in to comment.