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 {
26
26
} from '../utils/TypeUtil' ;
27
27
import { OptionsController } from './OptionsController' ;
28
28
import { ConstantsUtil } from '../utils/ConstantsUtil' ;
29
+ import { ApiUtil } from '../utils/ApiUtil' ;
29
30
30
31
// -- Helpers ------------------------------------------- //
31
32
const baseUrl = CoreHelperUtil . getBlockchainApiUrl ( ) ;
@@ -36,7 +37,9 @@ const getHeaders = () => {
36
37
return {
37
38
'Content-Type' : 'application/json' ,
38
39
'x-sdk-type' : sdkType ,
39
- 'x-sdk-version' : sdkVersion
40
+ 'x-sdk-version' : sdkVersion ,
41
+ 'User-Agent' : ApiUtil . getUserAgent ( ) ,
42
+ 'origin' : ApiUtil . getOrigin ( )
40
43
} ;
41
44
} ;
42
45
Original file line number Diff line number Diff line change @@ -14,13 +14,37 @@ export const ApiUtil = {
14
14
] . join ( '.' ) ;
15
15
} ,
16
16
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
+
17
37
getUserAgent ( ) {
18
38
const rnVersion = Platform . select ( {
19
39
ios : this . getReactNativeVersion ( ) ,
20
40
android : this . getReactNativeVersion ( ) ,
21
41
default : 'undefined'
22
42
} ) ;
23
43
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 ;
25
49
}
26
50
} ;
You can’t perform that action at this time.
0 commit comments