Repository: AppsFlyerSDK/appsflyer-unity-plugin
Branch: master
Commit: 087f87fc8179
Files: 212
Total size: 686.6 KB
Directory structure:
gitextract_u2enc1o6/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ └── config.yml
│ └── workflows/
│ ├── Scripts/
│ │ ├── checkJira.sh
│ │ └── extractPackage.py
│ ├── activation.yml
│ ├── check_packages.yml
│ ├── close_inactive_issues.yml
│ ├── issues_workflow.yml
│ ├── main.yml
│ ├── readme_sync.yml
│ ├── release_QA_workflow.yml
│ ├── release_production_workflow.yml
│ ├── release_to_QA.yml
│ ├── release_to_production.yml
│ ├── responseToSupportIssue.yml
│ ├── responseToSupportIssueOnOpen.yml
│ ├── test-unity-auth.yml
│ └── update_links.yml
├── .gitignore
├── Assets/
│ ├── AppsFlyer/
│ │ ├── AFAdRevenueData.cs
│ │ ├── AFAdRevenueData.cs.meta
│ │ ├── AFInAppEvents.cs
│ │ ├── AFInAppEvents.cs.meta
│ │ ├── AFMiniJSON.cs
│ │ ├── AFMiniJSON.cs.meta
│ │ ├── AFPurchaseDetailsAndroid.cs
│ │ ├── AFPurchaseDetailsAndroid.cs.meta
│ │ ├── AFSDKPurchaseDetailsIOS.cs
│ │ ├── AFSDKPurchaseDetailsIOS.cs.meta
│ │ ├── AFSDKValidateAndLogResult.cs
│ │ ├── AFSDKValidateAndLogResult.cs.meta
│ │ ├── AppsFlyer.asmdef
│ │ ├── AppsFlyer.asmdef.meta
│ │ ├── AppsFlyer.cs
│ │ ├── AppsFlyer.cs.meta
│ │ ├── AppsFlyerAndroid.cs
│ │ ├── AppsFlyerAndroid.cs.meta
│ │ ├── AppsFlyerConsent.cs
│ │ ├── AppsFlyerConsent.cs.meta
│ │ ├── AppsFlyerEventArgs.cs
│ │ ├── AppsFlyerEventArgs.cs.meta
│ │ ├── AppsFlyerObject.prefab
│ │ ├── AppsFlyerObject.prefab.meta
│ │ ├── AppsFlyerObjectScript.cs
│ │ ├── AppsFlyerObjectScript.cs.meta
│ │ ├── AppsFlyerPurchaseConnector.cs
│ │ ├── AppsFlyerPurchaseConnector.cs.meta
│ │ ├── AppsFlyeriOS.cs
│ │ ├── AppsFlyeriOS.cs.meta
│ │ ├── Editor/
│ │ │ ├── AppsFlyer.Editor.asmdef
│ │ │ ├── AppsFlyer.Editor.asmdef.meta
│ │ │ ├── AppsFlyerDependencies.xml
│ │ │ ├── AppsFlyerDependencies.xml.meta
│ │ │ ├── AppsFlyerObjectEditor.cs
│ │ │ ├── AppsFlyerObjectEditor.cs.meta
│ │ │ └── appsflyer_logo.png.meta
│ │ ├── Editor.meta
│ │ ├── IAppsFlyerAndroidBridge.cs
│ │ ├── IAppsFlyerAndroidBridge.cs.meta
│ │ ├── IAppsFlyerConversionData.cs
│ │ ├── IAppsFlyerConversionData.cs.meta
│ │ ├── IAppsFlyerIOSBridge.cs
│ │ ├── IAppsFlyerIOSBridge.cs.meta
│ │ ├── IAppsFlyerNativeBridge.cs
│ │ ├── IAppsFlyerNativeBridge.cs.meta
│ │ ├── IAppsFlyerPurchaseValidation.cs
│ │ ├── IAppsFlyerPurchaseValidation.cs.meta
│ │ ├── IAppsFlyerUserInvite.cs
│ │ ├── IAppsFlyerUserInvite.cs.meta
│ │ ├── IAppsFlyerValidateAndLog.cs
│ │ ├── IAppsFlyerValidateAndLog.cs.meta
│ │ ├── IAppsFlyerValidateReceipt.cs
│ │ ├── IAppsFlyerValidateReceipt.cs.meta
│ │ ├── Mac/
│ │ │ ├── AppsFlyerBundle.bundle/
│ │ │ │ ├── Contents/
│ │ │ │ │ ├── Info.plist
│ │ │ │ │ ├── Info.plist.meta
│ │ │ │ │ ├── MacOS/
│ │ │ │ │ │ ├── AppsFlyerBundle
│ │ │ │ │ │ └── AppsFlyerBundle.meta
│ │ │ │ │ ├── MacOS.meta
│ │ │ │ │ ├── _CodeSignature/
│ │ │ │ │ │ ├── CodeResources
│ │ │ │ │ │ └── CodeResources.meta
│ │ │ │ │ └── _CodeSignature.meta
│ │ │ │ └── Contents.meta
│ │ │ └── AppsFlyerBundle.bundle.meta
│ │ ├── Mac.meta
│ │ ├── Plugins/
│ │ │ ├── iOS/
│ │ │ │ ├── AFUnityStoreKit2Bridge.swift
│ │ │ │ ├── AFUnityStoreKit2Bridge.swift.meta
│ │ │ │ ├── AFUnityUtils.h
│ │ │ │ ├── AFUnityUtils.h.meta
│ │ │ │ ├── AFUnityUtils.mm
│ │ │ │ ├── AFUnityUtils.mm.meta
│ │ │ │ ├── AppsFlyer+AppController.m
│ │ │ │ ├── AppsFlyer+AppController.m.meta
│ │ │ │ ├── AppsFlyerAppController.mm
│ │ │ │ ├── AppsFlyerAppController.mm.meta
│ │ │ │ ├── AppsFlyerAttribution.h
│ │ │ │ ├── AppsFlyerAttribution.h.meta
│ │ │ │ ├── AppsFlyerAttribution.m
│ │ │ │ ├── AppsFlyerAttribution.m.meta
│ │ │ │ ├── AppsFlyeriOSWrapper.h
│ │ │ │ ├── AppsFlyeriOSWrapper.h.meta
│ │ │ │ ├── AppsFlyeriOSWrapper.mm
│ │ │ │ └── AppsFlyeriOSWrapper.mm.meta
│ │ │ └── iOS.meta
│ │ ├── Plugins.meta
│ │ ├── ProductPurchase.cs
│ │ ├── ProductPurchase.cs.meta
│ │ ├── Tests/
│ │ │ ├── Castle.Core.dll.meta
│ │ │ ├── NSubstitute.dll.meta
│ │ │ ├── System.Runtime.CompilerServices.Unsafe.dll.meta
│ │ │ ├── System.Threading.Tasks.Extensions.dll.meta
│ │ │ ├── Tests.asmdef
│ │ │ ├── Tests.asmdef.meta
│ │ │ ├── Tests_Suite.cs
│ │ │ └── Tests_Suite.cs.meta
│ │ ├── Tests.meta
│ │ ├── Windows/
│ │ │ ├── AppsFlyerLib.pdb
│ │ │ ├── AppsFlyerLib.pdb.meta
│ │ │ ├── AppsFlyerLib.pri
│ │ │ ├── AppsFlyerLib.pri.meta
│ │ │ ├── AppsFlyerLib.winmd
│ │ │ ├── AppsFlyerLib.winmd.meta
│ │ │ ├── AppsFlyerWindows.cs
│ │ │ └── AppsFlyerWindows.cs.meta
│ │ ├── Windows.meta
│ │ ├── package.json
│ │ └── package.json.meta
│ └── AppsFlyer.meta
├── CHANGELOG.md
├── LICENSE
├── ProjectSettings/
│ ├── AudioManager.asset
│ ├── ClusterInputManager.asset
│ ├── DynamicsManager.asset
│ ├── EditorBuildSettings.asset
│ ├── EditorSettings.asset
│ ├── GraphicsSettings.asset
│ ├── InputManager.asset
│ ├── MemorySettings.asset
│ ├── MultiplayerManager.asset
│ ├── NavMeshAreas.asset
│ ├── PackageManagerSettings.asset
│ ├── Physics2DSettings.asset
│ ├── PresetManager.asset
│ ├── ProjectSettings.asset
│ ├── ProjectVersion.txt
│ ├── QualitySettings.asset
│ ├── TagManager.asset
│ ├── TimeManager.asset
│ ├── UnityConnectSettings.asset
│ ├── VFXManager.asset
│ ├── VersionControlSettings.asset
│ └── XRSettings.asset
├── README.md
├── UserSettings/
│ ├── EditorUserSettings.asset
│ ├── Layouts/
│ │ ├── default-2021.dwlt
│ │ └── default-6000.dwlt
│ └── Search.settings
├── android-unity-wrapper/
│ ├── .gitignore
│ ├── app/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ ├── androidTest/
│ │ │ └── java/
│ │ │ └── com/
│ │ │ └── appsflyer/
│ │ │ └── unity/
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── drawable-v24/
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── mipmap-anydpi-v26/
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ └── values/
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── test/
│ │ └── java/
│ │ └── com/
│ │ └── appsflyer/
│ │ └── unity/
│ │ └── ExampleUnitTest.java
│ ├── build.gradle
│ ├── gradle/
│ │ └── wrapper/
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── unitywrapper/
│ ├── .gitignore
│ ├── build.gradle
│ ├── consumer-rules.pro
│ ├── libs/
│ │ └── classes.jar
│ ├── proguard-rules.pro
│ ├── publish.gradle
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ └── java/
│ └── com/
│ └── appsflyer/
│ └── unity/
│ ├── AppsFlyerAndroidWrapper.java
│ └── PurchaseRevenueBridge.java
├── appsflyer-unity-plugin-6.17.90.unitypackage
├── appsflyer-unity-plugin-6.17.91.unitypackage
├── deploy/
│ ├── build_unity_package.sh
│ ├── external-dependency-manager-1.2.183.unitypackage
│ └── strict_mode_build_package.sh
├── docs/
│ ├── API.md
│ ├── BasicIntegration.md
│ ├── DMAConsent.md
│ ├── DeepLinkIntegrate.md
│ ├── InAppEvents.md
│ ├── Installation.md
│ ├── Introduction.md
│ ├── MigrationGuide.md
│ ├── PushNotifications.md
│ ├── Testing.md
│ ├── Troubleshooting.md
│ ├── UnifiedDeepLink.md
│ ├── UninstallMeasurement.md
│ ├── UserInvite.md
│ ├── ad-revenue-unity.md
│ ├── conversion-data-unity.md
│ ├── purchase-connector.md
│ ├── purchase-validation-unity.md
│ └── validate-and-log-unity.md
├── obj/
│ └── Debug/
│ └── .NETFramework,Version=v4.7.1.AssemblyAttributes.cs
└── strict-mode-sdk/
├── appsflyer-unity-plugin-strict-mode-6.17.90.unitypackage
├── appsflyer-unity-plugin-strict-mode-6.17.91.unitypackage
└── strictMode.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
- name: AppsFlyer Support (Customer Assistant Chatbot)
url: https://support.appsflyer.com/hc/en-us/articles/23583984402193-Using-the-Customer-Assistant-Chatbot
about: For the fastest and most effective support, please contact the AppsFlyer support team using the Customer Assistant Chatbot.
================================================
FILE: .github/workflows/Scripts/checkJira.sh
================================================
JIRA_TOKEN=$1
JIRA_FIXED_VERSION=$2
fixed_version_found=false
curl -X GET https://appsflyer.atlassian.net/rest/api/3/project/11723/versions --user $JIRA_TOKEN | jq -r '.[] | .name+""+(.id | tostring)' | while read version ; do
if [[ "$version" == *"$JIRA_FIXED_VERSION"* ]] ;then
echo "$JIRA_FIXED_VERSION Found!"
fixed_version_found=true
version_id=${version#"$JIRA_FIXED_VERSION"}
echo $(curl -s -X POST https://appsflyer.atlassian.net/rest/api/3/search/jql --user $JIRA_TOKEN -H "Content-Type: application/json" -d "{\"jql\": \"fixVersion=$version_id\", \"fields\": [\"summary\"]}" | jq -r '.issues[] | "- " + .fields["summary"]+"@"') > "$JIRA_FIXED_VERSION-releasenotes".txt
sed -i -r -e "s/@ /\n/gi" "$JIRA_FIXED_VERSION-releasenotes".txt
sed -i -r -e "s/@/\n/gi" "$JIRA_FIXED_VERSION-releasenotes".txt
cat "$JIRA_FIXED_VERSION-releasenotes".txt
fi
done
if [ fixed_version_found == false ];then
echo "$JIRA_FIXED_VERSION is not found!"
exit 1
fi
================================================
FILE: .github/workflows/Scripts/extractPackage.py
================================================
from importlib.resources import path
import re
import hashlib
import os
import sys
from unitypackage_extractor.extractor import extractPackage
class checkPackage:
def __init__(self, pathToPackage):
self.pathToPackage = pathToPackage
def extractPackage(self, pathToOuptut):
extractPackage(self.pathToPackage, outputPath=pathToOuptut)
def main():
package = checkPackage(sys.argv[1])
strict_package = checkPackage(sys.argv[2])
#testing integreity of files
print("###################### \n Extracting files in unity packages \n ######################")
package.extractPackage("./packageUnity")
strict_package.extractPackage("./strictPackageUnity")
path_of_the_strict_directory= 'strictPackageUnity/'
path_of_the_directory= 'packageUnity/'
path_of_repo = "Assets/"
files_to_not_check = ["package.json"]
files_for_strict_mode_only = ["AppsFlyeriOSWrapper.mm", "AppsFlyerDependencies.xml"]
#checksum of files
print("###################### \n testing integreity of files \n ######################")
package.extractPackage("./packageUnity")
for subdir, dirs, files in os.walk(path_of_repo):
for file in files:
file_in_package = os.path.join(*[path_of_the_directory, subdir,file])
file_in_repo = os.path.join(subdir, file)
file_in_strict_package = os.path.join(*[path_of_the_strict_directory, subdir,file])
if os.path.isfile(file_in_package) and os.path.isfile(file_in_repo) and os.path.isfile(file_in_strict_package):
if file in files_to_not_check:
continue
if file in files_for_strict_mode_only:
if getHash(file_in_package) != getHash(file_in_repo):
print("❌ the file ", file, "is not the same")
sys.exit(5)
print("file for non strict mode ", file, "md5 check passed ✅")
if file == "AppsFlyeriOSWrapper.mm":
if not hasCommentedMethods(file_in_strict_package):
print("❌ the methods are not commented in ", file_in_strict_package)
sys.exit(5)
print("file in strict mode ", file, " has the correct methods commented out ✅")
if file == "AppsFlyerDependencies.xml":
if not isSrictModeDependency(file_in_strict_package):
print("❌ the dependecy is not strict in ",file_in_strict_package )
sys.exit(5)
print("file in strict mode ", file, " has the correct depdendency ✅")
else:
if getHash(file_in_package) != getHash(file_in_repo) or getHash(file_in_repo) != getHash(file_in_strict_package):
print("❌ the file" , file, "is not the same")
sys.exit(5)
print("file ", file, "md5 check passed ✅")
def getHash(filePath):
md5 = hashlib.md5()
with open(filePath,'rb') as file:
hash = file.read()
md5.update(hash)
return md5.hexdigest()
#check that only the two methods are commented in the strict mode package
def hasCommentedMethods(file):
print("###################### \n checking that the methods are commented in the strict mode package \n ######################")
textfile = open(file, 'r')
filetext = textfile.read()
textfile.close()
matches1 = re.findall("[/]+.*\[+AppsFlyerLib.*disableAdvertisingIdentifier", filetext)
matches2 = re.findall("[/]+.*\[+AppsFlyerLib.*waitForATTUserAuthorizationWithTimeoutInterval", filetext)
return len(matches1) == 1 and len(matches2) == 1
#check that we are using the strict dependency in strict mode package
def isSrictModeDependency(file):
print("###################### \nchecking the depdendency for the strict mode \n ######################")
textfile = open(file, 'r')
filetext = textfile.read()
textfile.close()
match = re.findall("AppsFlyerFramework/Strict", filetext)
return len(match)>0
if __name__ == "__main__":
main()
================================================
FILE: .github/workflows/activation.yml
================================================
name: Acquire activation file for Unity
on:
push:
branches:
- dev/RD-81493/unit-tests
jobs:
activation:
name: Request manual activation file 🔑
runs-on: ubuntu-latest
steps:
# Request manual activation file
- name: Request manual activation file
id: getManualLicenseFile
uses: game-ci/unity-request-activation-file@v2
# Upload artifact (Unity_v20XX.X.XXXX.alf)
- name: Expose as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.getManualLicenseFile.outputs.filePath }}
path: ${{ steps.getManualLicenseFile.outputs.filePath }}
================================================
FILE: .github/workflows/check_packages.yml
================================================
name: check packages and release to upm
on:
workflow_call:
inputs:
plugin_version:
required: true
type: string
jobs:
check-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get version
run: |
echo "PLUGIN_VERSION=${{ inputs.plugin_version }}" >> $GITHUB_ENV
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install unitypackage_extractor
- name: execute py script
run:
python .github/workflows/Scripts/extractPackage.py appsflyer-unity-plugin-${{env.PLUGIN_VERSION}}.unitypackage strict-mode-sdk/appsflyer-unity-plugin-strict-mode-${{env.PLUGIN_VERSION}}.unitypackage
release-upm:
runs-on: ubuntu-latest
needs: check-packages
steps:
- uses: actions/checkout@v4
- name: split branch
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git branch -d upm &> /dev/null || echo upm branch not found
git subtree split -P Assets/AppsFlyer -b upm
git checkout upm
echo "Checked out to upm branch"
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
git rm -r Tests
git commit -m "Remove Tests folder from upm branch"
echo "Removed Tests folder"
git push -f -u origin upm
- name: create tag
run: |
git tag v${{inputs.plugin_version}}
git push origin v${{inputs.plugin_version}}
echo "Release v${{inputs.plugin_version}} to upm :bookmark:"
strict-upm:
runs-on: ubuntu-latest
needs: check-packages
steps:
- uses: actions/checkout@v4
- name: split branch
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git branch -d Strict-upm &> /dev/null || echo Strict-upm branch not found
git subtree split -P Assets/AppsFlyer -b Strict-upm
git checkout Strict-upm
echo "Checked out to Strict-upm branch"
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
git rm -r Tests
git commit -m "Remove Tests folder from Strict-upm branch"
echo "Removed Tests folder"
- name: Modify for strict mode
run: |
echo "Changing AppsFlyerFramework to Strict Mode"
grep -q "AppsFlyerFramework" Editor/AppsFlyerDependencies.xml
sed -i 's/AppsFlyerFramework/AppsFlyerFramework\/Strict/g' Editor/AppsFlyerDependencies.xml
echo "Changing package.json to Strict Mode"
grep -q "AppsFlyer Unity plugin" ./package.json
sed -i 's/AppsFlyer Unity plugin/AppsFlyer Unity plugin strict mode/g' ./package.json
echo "Commenting out disableAdvertisingIdentifier"
grep -q "\[AppsFlyerLib shared\].disableAdvertisingIdentifier" Plugins/iOS/AppsFlyeriOSWrapper.mm
sed -i 's/\[AppsFlyerLib shared\].disableAdvertisingIdentifier/\/\/\[AppsFlyerLib shared\].disableAdvertisingIdentifier/g' Plugins/iOS/AppsFlyeriOSWrapper.mm
echo "Commenting out waitForATTUserAuthorizationWithTimeoutInterval"
grep -q "\[\[AppsFlyerLib shared\] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval\];" Plugins/iOS/AppsFlyeriOSWrapper.mm
sed -i 's/\[\[AppsFlyerLib shared\] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval\];/\/\/\[\[AppsFlyerLib shared\] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval\];/g' Plugins/iOS/AppsFlyeriOSWrapper.mm
- name: Commit changes and push
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git config user.name $COMMIT_AUTHOR
git config user.email $COMMIT_EMAIL
git add -A
git commit -m "update package.json"
git push -f -u origin Strict-upm
- name: create tag
run: |
git tag Strict-v${{inputs.plugin_version}}
git push origin Strict-v${{inputs.plugin_version}}
echo "Release Strict mode v${{inputs.plugin_version}} to upm :bookmark:"
================================================
FILE: .github/workflows/close_inactive_issues.yml
================================================
# This workflow triggers the org-wide reusable workflow to close inactive issues on a schedule
on:
schedule:
- cron: "0 10 * * *" # Runs daily at 10:00 UTC
workflow_dispatch:
jobs:
close-issues:
uses: AppsFlyerSDK/github-common-workflow-and-template/.github/workflows/close_inactive_issues.yml@main
secrets: inherit
================================================
FILE: .github/workflows/issues_workflow.yml
================================================
name: Close inactive issues
on:
schedule:
- cron: "30 9 * * 0"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 30
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .github/workflows/main.yml
================================================
name: Test runner unity-appsflyer-plugin
on:
workflow_call:
jobs:
run-unity-tests:
name: Run ${{ matrix.testMode }} tests for ${{ matrix.targetPlatform }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
testMode: [playmode]
targetPlatform: [iOS, Android, Shared]
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Free up disk space
run: |
rm -rf /usr/share/dotnet/
rm -rf "/usr/local/share/boost"
rm -rf "$AGENT_TOOLSDIRECTORY"
rm -rf /opt/ghc
- uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.targetPlatform }}-${{ matrix.testMode }}-${{ hashFiles('**/*.cs') }}
restore-keys: |
Library-${{ matrix.targetPlatform }}-${{ matrix.testMode }}-
Library-${{ matrix.targetPlatform }}-
Library-
- uses: game-ci/unity-test-runner@v4
id: tests
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
projectPath: .
testMode: ${{ matrix.testMode }}
artifactsPath: ${{ matrix.targetPlatform }}-artifacts
githubToken: ${{ secrets.GITHUB_TOKEN }}
checkName: ${{ matrix.targetPlatform }} Test Results
customParameters: >
-nographics
-buildTarget ${{ matrix.targetPlatform == 'Shared' && 'StandaloneLinux64' || matrix.targetPlatform }}
-defineSymbols ${{ matrix.targetPlatform == 'Shared' && '' || format('UNITY_{0}', matrix.targetPlatform) }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test results - ${{ matrix.targetPlatform }}
path: ${{ steps.tests.outputs.artifactsPath }}
================================================
FILE: .github/workflows/readme_sync.yml
================================================
name: Sync `docs` directory to ReadMe
# Run workflow for every push to the `main` branch
on:
push:
branches:
- master
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3
# Run GitHub Action to sync docs in `documentation` directory
- name: GitHub Action
# We recommend specifying a fixed version, i.e. @7.5.0
# Docs: https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#example-using-versioned-actions
uses: readmeio/rdme@7.5.0
with:
rdme: docs ./docs --key=${{ secrets.README_SYNC_API_KEY }} --version=0.1
================================================
FILE: .github/workflows/release_QA_workflow.yml
================================================
name: plugin release to QA
on:
push:
branches:
- releases/[0-9]+.x.x/[0-9]+.[0-9]+.x/[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
paths-ignore:
- master
jobs:
Run-Unit-Tests:
uses: ./.github/workflows/main.yml
secrets: inherit
Release-To-QA:
needs: [Run-Unit-Tests]
uses: ./.github/workflows/release_to_QA.yml
secrets: inherit
================================================
FILE: .github/workflows/release_production_workflow.yml
================================================
name: plugin release to Production workflow
on:
pull_request:
types:
- closed
branches:
- 'master'
paths-ignore:
- '**.md'
- 'docs/**.md'
- '**.sh'
jobs:
Prepare-Release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.tag-step.outputs.PLUGIN_VERSION}}
output2: ${{ steps.tag-step.outputs.RELEASE_BRANCH_NAME}}
steps:
- uses: actions/checkout@v3
- name: Login to GitHub
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME}}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL}}
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- uses: mdecoleman/pr-branch-name@1.2.0
id: vars
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Determine release tag and release branch
id: tag-step
run: |
TAG=$(echo "${{ steps.vars.outputs.branch }}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$TAG" >> $GITHUB_OUTPUT
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_ENV
echo "RELEASE_BRANCH_NAME=${{ steps.vars.outputs.branch }}" >> $GITHUB_OUTPUT
Check-Packages:
needs: [Prepare-Release]
uses: ./.github/workflows/check_packages.yml
with:
plugin_version: ${{ needs.Prepare-Release.outputs.output1 }}
secrets: inherit
Update-Links:
needs: [Prepare-Release, Check-Packages]
uses: ./.github/workflows/update_links.yml
secrets: inherit
Generate-Tag:
needs: [Prepare-Release, Check-Packages, Update-Links]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create a version tag and push it
run: |
echo "Pushing release tag: ${{ needs.Prepare-Release.outputs.output1 }}!"
git checkout master
echo "Checked out to master"
git pull origin master
git tag ${{ needs.Prepare-Release.outputs.output1 }}
echo "Created release tag"
git push origin ${{needs.Prepare-Release.outputs.output1}}
echo "Pushed release tag ${{ needs.Prepare-Release.outputs.output1 }}"
Release-To-Production:
needs: [Prepare-Release, Check-Packages, Update-Links, Generate-Tag]
uses: ./.github/workflows/release_to_production.yml
with:
plugin_version: ${{ needs.Prepare-Release.outputs.output1 }}
branch_name: ${{ needs.Prepare-Release.outputs.output2 }}
secrets: inherit
================================================
FILE: .github/workflows/release_to_QA.yml
================================================
name: Release to QA
on:
workflow_call:
jobs:
Release-To-QA:
runs-on: ubuntu-latest
environment: Staging
steps:
- uses: actions/checkout@v3
- name: Login to Github
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- name: Check fixed version and compare issues on Jira
env:
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
jira_fixed_version="Unity SDK v$plugin_version"
echo "JIRA_FIXED_VERSION=$jira_fixed_version" >> $GITHUB_ENV
chmod +x .github/workflows/Scripts/checkJira.sh
.github/workflows/Scripts/checkJira.sh $JIRA_TOKEN "$jira_fixed_version"
- name: Update package.json
env:
BRANCH_NAME: ${{ github.ref_name }}
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
echo "updating package.json version"
plugin_version=$(echo "$BRANCH_NAME" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
sed -E -i "s/\"version\": \"[0-9]+.[0-9]+.[0-9]+\"/\"version\": \"$plugin_version\"/g" Assets/AppsFlyer/package.json
if [[ -n $(git status -s) ]]; then
echo "Commit and push"
git add Assets/AppsFlyer/package.json
git commit -m "update package.json"
git push origin $BRANCH_NAME
else
echo "package.json version is already up to date"
fi
- name: Send slack report
env:
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }}
run: |
ios_af_sdk_version=$(cat README.md | grep -Eo 'iOS AppsFlyer SDK v[0-9]+.[0-9]+.[0-9]+')
android_af_sdk_version=$(cat README.md | grep -Eo 'Android AppsFlyer SDK v[0-9]+.[0-9]+.[0-9]+')
# Extract plugin version from branch name
plugin_version=$(echo "${{github.ref_name}}" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
# Send webhook to Slack with all required parameters
curl -X POST -H 'Content-type: application/json' --data '{
"plugin_version": "'"$plugin_version"'",
"git_branch": "'"${{github.ref_name}}"'",
"ios_sdk_dependency": "'"$ios_af_sdk_version"'",
"android_sdk_dependency": "'"$android_af_sdk_version"'",
"version_changes": "New Unity Plugin Release: Unity SDK v'"$plugin_version"'",
"deploy_type": "QA"
}' "$SLACK_TOKEN"
================================================
FILE: .github/workflows/release_to_production.yml
================================================
name: plugin release to Production
on:
workflow_call:
inputs:
plugin_version:
required: true
type: string
branch_name:
required: true
type: string
jobs:
Release-To-Production:
runs-on: ubuntu-latest
environment: Production
steps:
- uses: actions/checkout@v3
- name: Login to Github
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- name: Create GitHub Release
env:
VTAG: v${{ inputs.plugin_version }}
TAG: ${{ inputs.plugin_version }}
uses: "actions/github-script@v5"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
try {
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: false,
name: process.env.VTAG,
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: process.env.TAG
});
} catch (error) {
core.setFailed(error.message);
}
- name: Send slack report
env:
SLACK_TOKEN: ${{ secrets.CI_SLACK_TOKEN }}
JIRA_TOKEN: ${{ secrets.CI_JIRA_TOKEN }}
run: |
jira_fixed_version="Unity SDK v${{inputs.plugin_version}}"
chmod +x .github/workflows/Scripts/checkJira.sh
.github/workflows/Scripts/checkJira.sh $JIRA_TOKEN "$jira_fixed_version"
ios_af_sdk_version=$(cat README.md | grep -Eo 'iOS AppsFlyer SDK v[0-9]+.[0-9]+.[0-9]+')
android_af_sdk_version=$(cat README.md | grep -Eo 'Android AppsFlyer SDK v[0-9]+.[0-9]+.[0-9]+')
# Create a simple release message without the text file
release_message="🚀 PRODUCTION RELEASE: Unity Plugin ${{inputs.plugin_version}}"
# Send webhook to Slack with all required parameters
curl -X POST -H 'Content-type: application/json' --data '{
"plugin_version": "'"${{inputs.plugin_version}}"'",
"git_branch": "'"${{inputs.branch_name}}"'",
"ios_sdk_dependency": "'"$ios_af_sdk_version"'",
"android_sdk_dependency": "'"$android_af_sdk_version"'",
"version_changes": "🚀 PRODUCTION RELEASE: Unity Plugin ${{inputs.plugin_version}}",
"deploy_type": "PRODUCTION"
}' "$SLACK_TOKEN"
================================================
FILE: .github/workflows/responseToSupportIssue.yml
================================================
# This workflow triggers the org-wide reusable workflow to respond to issues labeled as 'support'
on:
issues:
types:
- labeled
workflow_dispatch:
jobs:
add-comment:
uses: AppsFlyerSDK/github-common-workflow-and-template/.github/workflows/responseToSupportIssue.yml@main
secrets: inherit
================================================
FILE: .github/workflows/responseToSupportIssueOnOpen.yml
================================================
# This workflow triggers the org-wide reusable workflow to respond to newly opened issues
on:
issues:
types:
- opened
workflow_dispatch:
jobs:
add-comment:
uses: AppsFlyerSDK/github-common-workflow-and-template/.github/workflows/responseToSupportIssueOnOpen.yml@main
secrets: inherit
================================================
FILE: .github/workflows/test-unity-auth.yml
================================================
name: Test Unity Authentication
on:
workflow_dispatch:
jobs:
test-auth:
name: Test Unity License Activation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test Unity activation
uses: game-ci/unity-activate@v2
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
- name: Success message
run: echo "Unity authentication successful!"
================================================
FILE: .github/workflows/update_links.yml
================================================
name: update sdk links
on:
workflow_call:
jobs:
update-links:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Update links
id: update-links
env:
COMMIT_AUTHOR: ${{ secrets.CI_USERNAME }}
COMMIT_EMAIL: ${{ secrets.CI_EMAIL }}
run: |
echo "Getting the versions"
grep -o 'spec="com.appsflyer:[^"]\+"' Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml | sed -E 's/spec="com.appsflyer:([^"]+)"/\1/' | awk -F':' '{print $2}' > output.txt
grep -o 'name="AppsFlyerFramework" version="[^"]\+"' Assets/AppsFlyer/Editor/AppsFlyerDependencies.xml | sed -E 's/name="AppsFlyerFramework" version="([^"]+)"/\1/' >> output.txt
echo "Changing links"
android_version=$(sed -n '1p' output.txt)
sed -E -i "s/af-android-sdk\/[0-9]+.[0-9]+.[0-9]+/af-android-sdk\/$android_version/g" docs/Installation.md
sed -E -i "s/af-android-sdk-[0-9]+.[0-9]+.[0-9]+/af-android-sdk-$android_version/g" docs/Installation.md
wrapper_version=$(sed -n '2p' output.txt)
sed -E -i "s/unity-wrapper\/[0-9]+.[0-9]+.[0-9]+/unity-wrapper\/$wrapper_version/g" docs/Installation.md
sed -E -i "s/unity-wrapper-[0-9]+.[0-9]+.[0-9]+/unity-wrapper-$wrapper_version/g" docs/Installation.md
ios_version=$(sed -n '3p' output.txt)
major_version="${ios_version%%.*}"
minor_version="${ios_version%.*}"
sed -E -i "s/appsflyer.com\/ios\/[0-9]+.x.x\/[0-9]+.[0-9]+.x\/[0-9]+.[0-9]+.[0-9]+\/AF-iOS-SDK-v[0-9]+.[0-9]+.[0-9]+/appsflyer.com\/ios\/$major_version.x.x\/$minor_version.x\/$ios_version\/AF-iOS-SDK-v$ios_version/g" docs/Installation.md
sed -E -i "s/unity-wrapper-[0-9]+.[0-9]+.[0-9]+/unity-wrapper-$wrapper_version/g" docs/Installation.md
rm output.txt
if [[ -n $(git status -s) ]]; then
echo "Links need updating, will create PR"
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
git add docs/Installation.md
git commit -m "generate links"
echo "changes_made=true" >> $GITHUB_OUTPUT
else
echo "Links are already up to date"
echo "changes_made=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.update-links.outputs.changes_made == 'true'
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "generate links"
title: "Update SDK links for version ${{ inputs.plugin_version || 'latest' }}"
body: |
This PR automatically updates the SDK links in the Installation.md file.
**Changes:**
- Updated Android SDK links
- Updated iOS SDK links
- Updated Unity wrapper links
This PR was created automatically by the release workflow.
branch: update-links-${{ github.run_number }}
base: master
delete-branch: true
================================================
FILE: .gitignore
================================================
.DS_Store
*.log
Logs/
Packages/
Temp/
Library/
/*/outputs/
#android studio
build
gen
.gradle
.idea
.hgcheck
infer-out
captures
local.properties
*.orig
*.rej
out
bin
dist
*.iml
build.gradle_mine
.DS_Store
*.idea
.vs/appsflyer-unity-plugin/xs/project-cache/
.vs/appsflyer-unity-plugin/xs/
.vsconfig
*.sln
*.csproj
*.cache
================================================
FILE: Assets/AppsFlyer/AFAdRevenueData.cs
================================================
using System;
using System.Collections.Generic;
namespace AppsFlyerSDK
{
public enum MediationNetwork : ulong
{
GoogleAdMob = 1,
IronSource = 2,
ApplovinMax = 3,
Fyber = 4,
Appodeal = 5,
Admost = 6,
Topon = 7,
Tradplus = 8,
Yandex = 9,
ChartBoost = 10,
Unity = 11,
ToponPte = 12,
Custom = 13,
DirectMonetization = 14
}
public static class AdRevenueScheme
{
/**
* code ISO 3166-1 format
*/
public const string COUNTRY = "country";
/**
* ID of the ad unit for the impression
*/
public const string AD_UNIT = "ad_unit";
/**
* Format of the ad
*/
public const string AD_TYPE = "ad_type";
/**
* ID of the ad placement for the impression
*/
public const string PLACEMENT = "placement";
}
///
// Data class representing ad revenue information.
//
// @property monetizationNetwork The name of the network that monetized the ad.
// @property mediationNetwork An instance of MediationNetwork representing the mediation service used.
// @property currencyIso4217Code The ISO 4217 currency code describing the currency of the revenue.
// @property eventRevenue The amount of revenue generated by the ad.
///
public class AFAdRevenueData
{
public string monetizationNetwork { get; private set; }
public MediationNetwork mediationNetwork { get; private set; }
public string currencyIso4217Code { get; private set; }
public double eventRevenue { get; private set; }
public AFAdRevenueData(string monetization, MediationNetwork mediation, string currency, double revenue)
{
monetizationNetwork = monetization;
mediationNetwork = mediation;
currencyIso4217Code = currency;
eventRevenue = revenue;
}
}
}
================================================
FILE: Assets/AppsFlyer/AFAdRevenueData.cs.meta
================================================
fileFormatVersion: 2
guid: 49e1906ae949e4bfea400bd1da9f7e39
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/AppsFlyer/AFInAppEvents.cs
================================================
using UnityEngine;
using System.Collections;
public class AFInAppEvents {
/**
* Event Type
* */
public const string LEVEL_ACHIEVED = "af_level_achieved";
public const string ADD_PAYMENT_INFO = "af_add_payment_info";
public const string ADD_TO_CART = "af_add_to_cart";
public const string ADD_TO_WISH_LIST = "af_add_to_wishlist";
public const string COMPLETE_REGISTRATION = "af_complete_registration";
public const string TUTORIAL_COMPLETION = "af_tutorial_completion";
public const string INITIATED_CHECKOUT = "af_initiated_checkout";
public const string PURCHASE = "af_purchase";
public const string RATE = "af_rate";
public const string SEARCH = "af_search";
public const string SPENT_CREDIT = "af_spent_credits";
public const string ACHIEVEMENT_UNLOCKED = "af_achievement_unlocked";
public const string CONTENT_VIEW = "af_content_view";
public const string TRAVEL_BOOKING = "af_travel_booking";
public const string SHARE = "af_share";
public const string INVITE = "af_invite";
public const string LOGIN = "af_login";
public const string RE_ENGAGE = "af_re_engage";
public const string UPDATE = "af_update";
public const string OPENED_FROM_PUSH_NOTIFICATION = "af_opened_from_push_notification";
public const string LOCATION_CHANGED = "af_location_changed";
public const string LOCATION_COORDINATES = "af_location_coordinates";
public const string ORDER_ID = "af_order_id";
/**
* Event Parameter Name
* **/
public const string LEVEL = "af_level";
public const string SCORE = "af_score";
public const string SUCCESS = "af_success";
public const string PRICE = "af_price";
public const string CONTENT_TYPE = "af_content_type";
public const string CONTENT_ID = "af_content_id";
public const string CONTENT_LIST = "af_content_list";
public const string CURRENCY = "af_currency";
public const string QUANTITY = "af_quantity";
public const string REGSITRATION_METHOD = "af_registration_method";
public const string PAYMENT_INFO_AVAILIBLE = "af_payment_info_available";
public const string MAX_RATING_VALUE = "af_max_rating_value";
public const string RATING_VALUE = "af_rating_value";
public const string SEARCH_STRING = "af_search_string";
public const string DATE_A = "af_date_a";
public const string DATE_B = "af_date_b";
public const string DESTINATION_A = "af_destination_a";
public const string DESTINATION_B = "af_destination_b";
public const string DESCRIPTION = "af_description";
public const string CLASS = "af_class";
public const string EVENT_START = "af_event_start";
public const string EVENT_END = "af_event_end";
public const string LATITUDE = "af_lat";
public const string LONGTITUDE = "af_long";
public const string CUSTOMER_USER_ID = "af_customer_user_id";
public const string VALIDATED = "af_validated";
public const string REVENUE = "af_revenue";
public const string RECEIPT_ID = "af_receipt_id";
public const string PARAM_1 = "af_param_1";
public const string PARAM_2 = "af_param_2";
public const string PARAM_3 = "af_param_3";
public const string PARAM_4 = "af_param_4";
public const string PARAM_5 = "af_param_5";
public const string PARAM_6 = "af_param_6";
public const string PARAM_7 = "af_param_7";
public const string PARAM_8 = "af_param_8";
public const string PARAM_9 = "af_param_9";
public const string PARAM_10 = "af_param_10";
}
================================================
FILE: Assets/AppsFlyer/AFInAppEvents.cs.meta
================================================
fileFormatVersion: 2
guid: 4075c6cf6f3d94b9a9f37f826e6a0e6f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
================================================
FILE: Assets/AppsFlyer/AFMiniJSON.cs
================================================
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace AFMiniJSON {
// Example usage:
//
// using UnityEngine;
// using System.Collections;
// using System.Collections.Generic;
// using MiniJSON;
//
// public class MiniJSONTest : MonoBehaviour {
// void Start () {
// var jsonString = "{ \"array\": [1.44,2,3], " +
// "\"object\": {\"key1\":\"value1\", \"key2\":256}, " +
// "\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " +
// "\"unicode\": \"\\u3041 Men\u00fa sesi\u00f3n\", " +
// "\"int\": 65536, " +
// "\"float\": 3.1415926, " +
// "\"bool\": true, " +
// "\"null\": null }";
//
// var dict = Json.Deserialize(jsonString) as Dictionary;
//
// Debug.Log("deserialized: " + dict.GetType());
// Debug.Log("dict['array'][0]: " + ((List