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
0a43555
commit e743ef6
Showing
9 changed files
with
88 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./expo/withAppsFlyer'); |
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,5 @@ | ||
{ | ||
"ios": { | ||
"appDelegateSubscribers": ["AppLifecycleDelegate"] | ||
} | ||
} |
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,5 @@ | ||
const withAppsFlyerIos = require('react-native-appsflyer/expo/withAppsFlyerIos.js'); | ||
module.exports = function withAppsFlyer(config, { shouldUseStrictMode = false }) { | ||
config = withAppsFlyerIos(config, shouldUseStrictMode); | ||
return config; | ||
}; |
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,33 @@ | ||
const pkg = require('react-native-appsflyer/package.json'); | ||
const { withDangerousMod } = require('@expo/config-plugins'); | ||
const { mergeContents } = require('@expo/config-plugins/build/utils/generateCode'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
module.exports = function withAppsFlyerIos(config, shouldUseStrictMode) { | ||
return withDangerousMod(config, [ | ||
'ios', | ||
async (config) => { | ||
const filePath = path.join(config.modRequest.platformProjectRoot, 'Podfile'); | ||
const contents = fs.readFileSync(filePath, 'utf-8'); | ||
|
||
const configureStrictMode = mergeContents({ | ||
tag: 'AppsFlyer Strict Mode', | ||
src: contents, | ||
newSrc: ` $RNAppsFlyerStrictMode == ${shouldUseStrictMode}`, | ||
anchor: "target 'expoAppsFlyerTest' do", | ||
offset: 0, | ||
comment: '#', | ||
}); | ||
|
||
if (!configureStrictMode.didMerge) { | ||
console.log("ERROR: Cannot add AppsFlyer strict mode to the project's ios/Podfile because it's malformed. Please report this with a copy of your project Podfile."); | ||
return config; | ||
} | ||
|
||
fs.writeFileSync(filePath, configureStrictMode.contents); | ||
|
||
return config; | ||
}, | ||
]); | ||
}; |
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,16 @@ | ||
// | ||
// RNAFSDKAppLifecycleDelegate.swift | ||
// RNAppsFlyer | ||
// | ||
// Created by Amit Kremer on 25/01/2022. | ||
// Copyright © 2022 Facebook. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import ExpoModulesCore | ||
|
||
public class RNAFSDKAppLifecycleDelegate: ExpoAppDelegateSubscriber { | ||
public func applicationDidBecomeActive(_ application: UIApplication) { | ||
print("EXPOOO didbecomeactive") | ||
} | ||
} |
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 |
---|---|---|
|
@@ -55,5 +55,8 @@ | |
"setupFiles": [ | ||
"<rootDir>/__tests__/setup.js" | ||
] | ||
}, | ||
"peerDependencies": { | ||
"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