-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from fabOnReact/implement-watch-example
Implement watch example and basic send message api
- Loading branch information
Showing
67 changed files
with
15,692 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,5 @@ android/keystores/debug.keystore | |
|
||
# generated by bob | ||
lib/ | ||
example/.env | ||
watch-example/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { | ||
View, | ||
StyleSheet, | ||
Text, | ||
TextInput, | ||
NativeModules, | ||
Button, | ||
} from 'react-native'; | ||
import {GoogleSignin} from '@react-native-google-signin/google-signin'; | ||
import Config from 'react-native-config'; | ||
|
||
export default function LoginScreen() { | ||
const signIn = async () => { | ||
try { | ||
GoogleSignin.configure({ | ||
androidClientId: Config.GOOGLE_ANDROID_CLIENT_ID, | ||
}); | ||
const userInfo = await GoogleSignin.signIn(); | ||
console.log(JSON.stringify(userInfo)); | ||
} catch (error) { | ||
console.log('ERROR IS: ' + JSON.stringify(error)); | ||
} | ||
}; | ||
|
||
return ( | ||
<View> | ||
<Button title={'Sign in with Google'} onPress={signIn} /> | ||
</View> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { useEffect } from 'react'; | ||
import { | ||
DeviceEventEmitter, | ||
NativeEventEmitter, | ||
View, | ||
StyleSheet, | ||
Text, | ||
NativeModules, | ||
Button, | ||
} from 'react-native'; | ||
import { multiply, increaseWearCounter } from 'react-native-wear-connectivity'; | ||
|
||
const INCREASE_COUNTER_EVENT = 'increaseCounter'; | ||
|
||
export default function WearCounter() { | ||
const [count, setCount] = React.useState(0); | ||
|
||
useEffect(() => { | ||
const eventEmitter = new NativeEventEmitter( | ||
NativeModules.AndroidWearCommunication | ||
); | ||
let eventListener = eventEmitter.addListener(INCREASE_COUNTER_EVENT, () => { | ||
setCount((prevCount) => prevCount + 1); | ||
}); | ||
|
||
return () => { | ||
eventListener.remove(); | ||
}; | ||
}, []); | ||
|
||
const onPressHandler = () => { | ||
console.log('onPressHandler'); | ||
increaseWearCounter(); | ||
}; | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.counter}>{count}</Text> | ||
<Button title="increase counter" onPress={onPressHandler} /> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: 'center', | ||
padding: 8, | ||
backgroundColor: 'yellow', | ||
}, | ||
counter: { | ||
height: 100, | ||
width: 400, | ||
textAlign: 'center', | ||
fontSize: 50, | ||
fontWeight: 'bold', | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source 'https://rubygems.org' | ||
|
||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby ">= 2.6.10" | ||
|
||
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper | ||
# bound in the template on Cocoapods with next React Native release. | ||
gem 'cocoapods', '>= 1.13', '< 1.15' | ||
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0' |
Oops, something went wrong.