[🏁 #8] Play Store referrer (#4361)

* add new module for referrer api

* add dependency

* rm boiler

* return the result

* end connection when finished

* add js types
This commit is contained in:
Hailey
2024-06-04 13:20:39 -07:00
committed by GitHub
parent 8f9898e74c
commit 81cd1e0f2a
8 changed files with 134 additions and 0 deletions
@@ -0,0 +1,9 @@
export type GooglePlayReferrerInfo = {
installReferrer: string
clickTimestamp: number
installTimestamp: number
}
export type ExpoGooglePlayReferrerModule = {
getReferrerInfoAsync(): Promise<GooglePlayReferrerInfo>
}
@@ -0,0 +1,6 @@
import {requireNativeModule} from 'expo-modules-core'
import {ExpoGooglePlayReferrerModule} from './ExpoGooglePlayReferrer.types'
export const BackgroundNotificationHandler =
requireNativeModule<ExpoGooglePlayReferrerModule>('ExpoGooglePlayReferrer')
@@ -0,0 +1,11 @@
import {
ExpoGooglePlayReferrerModule,
GooglePlayReferrerInfo,
} from './ExpoGooglePlayReferrer.types'
export const GooglePlayReferrerModule = {
getReferrerInfoAsync(): Promise<GooglePlayReferrerInfo> {
console.error('getReferrerInfoAsync is only available on Android')
return Promise.reject('getReferrerInfoAsync is only available on Android')
},
} as ExpoGooglePlayReferrerModule