GoodDAPP
GoodDAPP copied to clipboard
Create separate eToro instance for wallet.gooddollar.org
- [x] delta.gooddollar.org
- [x] use PROD env
- [x] add specific flag REACT_APP_ETORO
- [x] postMessage for all events sent / messages logged
- [x] disable browser compatibility if flag set
- [x] disable addwebapp if flag set
- [x] do not send logs just events
- [x] add login event if need (or provider correct event name)
- [x]
Issues
- [x] looks like realmdb, celo rpc and torus endpoint have no delta.gooddollar.org in the whitelisted origins which causes CORS errors @sirpy
- custom wallet instance available at https://delta.gooddollar.org
- what had been adjusted:
- no "Switch to Safari or Chrome" banner at boot screen, browser compatibility check been disabled
- no "smart banner" - suggestion to install app from the Google Play
- no banner with proposition to add app icon to the home screen
- All analytics events and logs propagating through the ReactNativeWebView.postMessage interface
Log messages shape:
{
type: <one of log levels, lowecased> https://github.com/jonnyreeves/js-logger/blob/master/src/logger.js#L50,
name: <name of the component, hook or api/service>
messages: [array, of, args, been, logged]
}
Event shape:
{
type: 'event',
event: <one of the GD analytics events predefined> https://github.com/GoodDollar/GoodDAPP/blob/master/src/lib/analytics/constants.js,
data?: <custom data object>
}
Not that implementation is strictly tied to RN WebView. Data is sent/received as JSON-stringified text
Example app:
import React, { useMemo, useEffect, useCallback } from 'react';
import { useColorScheme, SafeAreaView, ScrollView, StatusBar, View, Text, Dimensions } from 'react-native'
import { WebView } from 'react-native-webview'
function App(): JSX.Element {
const { width, height } = useMemo(() => Dimensions.get('window'), [])
const isDarkMode = useColorScheme() === 'dark';
const backgroundStyle = {
backgroundColor: isDarkMode ? '#222' : '#444',
};
const webViewStyle = {
flex: 1,
backgroundColor: '#fff',
width,
height,
}
const onMessage = useCallback(({ nativeEvent }) => console.log(JSON.parse(nativeEvent.data)), [])
return (
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}
>
<WebView
style={webViewStyle}
title={"GoodDollar Wallet"}
source={{ uri: "https://delta.gooddollar.org" }}
scrollEnabled={true}
originWhitelist={['*']}
onMessage={onMessage}
/>
</ScrollView>
</SafeAreaView>
);
}
export default App;
To allow send form iframe - ask me for updated solution @peterfo-tr @sunela-tr Also ask me regarding handling urls (deep links ?)
I see GOTO_CHOOSEAUTH and SIGNIN_METHOD_SELECTED but don’t immediately see an event when the user actually signed in and the below screen is displayed. Is there one I should see?
Will give an answer during the day. In short words - as we’re reloading app after login/logout there’s two options a) to handle last screen of auth flow (when you just have logged) b) to handle AppRouter effect tracking isLoggedIn (after app been reloaded) I’ll search for proper events or debug logs to track
Breaking changes
- removed all log events
- added new 'identify' event type emitted when our analytics receives user data
{
type: 'identify',
email: user's email
identifier?: user's ID (only for signed users, not available during signup)
signup: true|false
}
About your issue
- To catch a moment when user exactly logs in, You need to track the following events:
- SIGNIN_TORUS_SUCCESS (emitter if user had GD account)
- SIGNUP_SUCCESS (emitter if user had no account and was signed up) Listen for type = 'event' and event = one of those names
- To catch a moment when the screen from above is shown after login, track for the next one identify event Listen for type = 'identify' and signup = false
@johnsmith-gooddollar added domain to pokt and mongodb
@sirpy Thanks. Checked Google & FB, awaiting for eToro's confirmation
@sirpy they have issues with password less:
It seems delta.gooddollar.org still not enabled on 0auth PROD redirect uri should be exactly like for wallet.gooddollar.org just domain is delta. https://wallet.gooddollar.org/Welcome/Auth is used for Torus as I remember so it should be https://delta.gooddollar.org/Welcome/Auth