File tree Expand file tree Collapse file tree 3 files changed +47
-2
lines changed
Expand file tree Collapse file tree 3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @reown/appkit-coinbase-ethers-react-native ' : patch
3+ ' @reown/appkit-coinbase-wagmi-react-native ' : patch
4+ ' @reown/appkit-scaffold-utils-react-native ' : patch
5+ ' @reown/appkit-auth-ethers-react-native ' : patch
6+ ' @reown/appkit-auth-wagmi-react-native ' : patch
7+ ' @reown/appkit-scaffold-react-native ' : patch
8+ ' @reown/appkit-ethers5-react-native ' : patch
9+ ' @reown/appkit-common-react-native ' : patch
10+ ' @reown/appkit-ethers-react-native ' : patch
11+ ' @reown/appkit-wagmi-react-native ' : patch
12+ ' @reown/appkit-core-react-native ' : patch
13+ ' @reown/appkit-siwe-react-native ' : patch
14+ ' @reown/appkit-ui-react-native ' : patch
15+ ' @reown/appkit-wallet-react-native ' : patch
16+ ---
17+
18+ chore: send expo info in useragent
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import type {
2626} from '../utils/TypeUtil' ;
2727import { OptionsController } from './OptionsController' ;
2828import { ConstantsUtil } from '../utils/ConstantsUtil' ;
29+ import { ApiUtil } from '../utils/ApiUtil' ;
2930
3031// -- Helpers ------------------------------------------- //
3132const baseUrl = CoreHelperUtil . getBlockchainApiUrl ( ) ;
@@ -36,7 +37,9 @@ const getHeaders = () => {
3637 return {
3738 'Content-Type' : 'application/json' ,
3839 'x-sdk-type' : sdkType ,
39- 'x-sdk-version' : sdkVersion
40+ 'x-sdk-version' : sdkVersion ,
41+ 'User-Agent' : ApiUtil . getUserAgent ( ) ,
42+ 'origin' : ApiUtil . getOrigin ( )
4043 } ;
4144} ;
4245
Original file line number Diff line number Diff line change @@ -14,13 +14,37 @@ export const ApiUtil = {
1414 ] . join ( '.' ) ;
1515 } ,
1616
17+ getEnvironment ( ) {
18+ try {
19+ // Check if Expo is installed
20+ const hasExpoGlobal = ! ! ( global as any ) . expo ;
21+ const hasExpoConstants = hasExpoGlobal && ( global as any ) . expo ?. modules ?. ExponentConstants ;
22+ const environment : string | undefined =
23+ hasExpoConstants && ( global as any ) . expo ?. modules ?. ExponentConstants ?. executionEnvironment ;
24+
25+ if ( environment === 'standalone' || environment === 'storeClient' ) {
26+ return 'expo-managed' ;
27+ } else if ( environment === 'bare' ) {
28+ return 'expo-bare' ;
29+ }
30+
31+ return 'bare' ;
32+ } catch {
33+ return 'bare' ;
34+ }
35+ } ,
36+
1737 getUserAgent ( ) {
1838 const rnVersion = Platform . select ( {
1939 ios : this . getReactNativeVersion ( ) ,
2040 android : this . getReactNativeVersion ( ) ,
2141 default : 'undefined'
2242 } ) ;
2343
24- return `${ Platform . OS } -${ Platform . Version } @rn-${ rnVersion } ` ;
44+ const envPrefix = this . getEnvironment ( ) ;
45+
46+ const userAgent = `${ Platform . OS } -${ Platform . Version } @rn-${ rnVersion } @${ envPrefix } ` ;
47+
48+ return userAgent ;
2549 }
2650} ;
You can’t perform that action at this time.
0 commit comments