forked from AppsFlyerSDK/appsflyer-react-native-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e62ece
commit d7b8e5c
Showing
15 changed files
with
204 additions
and
1 deletion.
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
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,50 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { StyleSheet, Text, View, ScrollView, Button } from 'react-native'; | ||
import appsFlyer from 'react-native-appsflyer'; | ||
|
||
export default function App() { | ||
const [gcd, setGcd] = useState('No GCD Yet...'); | ||
const [oaoa, setOaoa] = useState('No UDL Yet...'); | ||
|
||
const option = { | ||
isDebug: true, | ||
devKey: 'Us4xXxXxXxQed', | ||
onInstallConversionDataListener: true, | ||
onDeepLinkListener: true, | ||
timeToWaitForATTUserAuthorization: 5, | ||
appId: '7xXxXxXx1', | ||
}; | ||
useEffect(() => { | ||
const gcdListener = appsFlyer.onInstallConversionData((res) => setGcd(JSON.stringify(res, null, 5))); | ||
const oaoaListener = appsFlyer.onDeepLink((res) => setOaoa(JSON.stringify(res, null, 5))); | ||
appsFlyer.initSdk(option, null, null); | ||
return () => {}; | ||
}, []); | ||
return ( | ||
<View style={[{ flex: 1, marginTop: 30 }]}> | ||
<View style={[{ flex: 2 }]}> | ||
<View style={{ backgroundColor: 'grey', alignItems: 'center' }}> | ||
<Text>GCD</Text> | ||
</View> | ||
<ScrollView contentContainerStyle={{ alignItems: 'center' }}> | ||
<Text style={[]}>{gcd}</Text> | ||
</ScrollView> | ||
</View> | ||
<View style={[{ flex: 2 }]}> | ||
<View style={{ backgroundColor: 'grey', alignItems: 'center' }}> | ||
<Text>UDL</Text> | ||
</View> | ||
<ScrollView contentContainerStyle={{ alignItems: 'center' }}> | ||
<Text style={[]}>{oaoa}</Text> | ||
</ScrollView> | ||
</View> | ||
<View style={[{ flex: 1 }]}> | ||
<Button title='Log Event' onPress={() => console.log('la')} /> | ||
</View> | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: {}, | ||
}); |
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,14 @@ | ||
# AppsFlyer-Expo Shop Sample App | ||
|
||
Basic integration example of AppsFlyer React-Native plugin in an Expo app. Please take a look on the example `app.json` | ||
#### First run | ||
In the root folder of the the app (appsflyer-expo-app and **not** appsflyer-react-native-plugin) run:<br> | ||
`yarn install`<br> | ||
|
||
#### Generate native folders: | ||
run `expo prebuild` | ||
|
||
#### Android: | ||
run `npm run android` | ||
#### iOS: | ||
run `npm run ios` |
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,70 @@ | ||
{ | ||
"expo": { | ||
"name": "expoAppsFlyer", | ||
"slug": "expoAppsFlyer", | ||
"version": "1.0.0", | ||
"orientation": "portrait", | ||
"icon": "./assets/atom.png", | ||
"splash": { | ||
"image": "./assets/splash.png", | ||
"resizeMode": "contain", | ||
"backgroundColor": "#ffffff" | ||
}, | ||
"plugins": [ | ||
[ | ||
"react-native-appsflyer", | ||
{"shouldUseStrictMode": false} | ||
] | ||
], | ||
"updates": { | ||
"fallbackToCacheTimeout": 0 | ||
}, | ||
"assetBundlePatterns": [ | ||
"**/*" | ||
], | ||
"scheme": "amitkremer", | ||
"ios": { | ||
"supportsTablet": true, | ||
"bundleIdentifier": "com.appsflyer.bundleId", | ||
"associatedDomains": ["applinks:appsflyer.onelink.me"] | ||
}, | ||
"android": { | ||
"adaptiveIcon": { | ||
"foregroundImage": "./assets/adaptive-icon.png", | ||
"backgroundColor": "#FFFFFF" | ||
}, | ||
"package": "com.expo.rntest", | ||
"intentFilters": [ | ||
{ | ||
"action": "VIEW", | ||
"data": [ | ||
{ | ||
"scheme": "https", | ||
"host": "appsflyer.onelink.me", | ||
"pathPrefix": "/DvWi" | ||
} | ||
], | ||
"category": [ | ||
"BROWSABLE", | ||
"DEFAULT" | ||
] | ||
}, | ||
{ | ||
"action": "VIEW", | ||
"data": [ | ||
{ | ||
"scheme": "myScheme" | ||
} | ||
], | ||
"category": [ | ||
"BROWSABLE", | ||
"DEFAULT" | ||
] | ||
} | ||
] | ||
}, | ||
"web": { | ||
"favicon": "./assets/favicon.png" | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,6 @@ | ||
module.exports = function(api) { | ||
api.cache(true); | ||
return { | ||
presets: ['babel-preset-expo'], | ||
}; | ||
}; |
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,18 @@ | ||
{ | ||
"cli": { | ||
"version": ">= 0.48.2" | ||
}, | ||
"build": { | ||
"development": { | ||
"developmentClient": true, | ||
"distribution": "internal" | ||
}, | ||
"preview": { | ||
"distribution": "internal" | ||
}, | ||
"production": {} | ||
}, | ||
"submit": { | ||
"production": {} | ||
} | ||
} |
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,10 @@ | ||
import 'expo-dev-client'; | ||
|
||
import { registerRootComponent } from 'expo'; | ||
|
||
import App from './App'; | ||
|
||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App); | ||
// It also ensures that whether you load the app in Expo Go or in a native build, | ||
// the environment is set up appropriately | ||
registerRootComponent(App); |
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,4 @@ | ||
// Learn more https://docs.expo.io/guides/customizing-metro | ||
const { getDefaultConfig } = require('expo/metro-config'); | ||
|
||
module.exports = getDefaultConfig(__dirname); |
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,26 @@ | ||
{ | ||
"name": "expoappsflyer", | ||
"version": "1.0.0", | ||
"scripts": { | ||
"start": "expo start --dev-client", | ||
"android": "expo run:android", | ||
"ios": "expo run:ios", | ||
"web": "expo start --web", | ||
"eject": "expo eject" | ||
}, | ||
"dependencies": { | ||
"expo": "~45.0.0", | ||
"expo-dev-client": "~0.9.5", | ||
"expo-splash-screen": "~0.15.1", | ||
"expo-status-bar": "~1.3.0", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2", | ||
"react-native": "0.68.2", | ||
"react-native-appsflyer": "6.6.0", | ||
"react-native-web": "0.17.7" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.12.9" | ||
}, | ||
"private": true | ||
} |