react native appsflyer deep link 완벽 가이드 - 초기 설정 (1)

react native appsflyer deep link 완벽 가이드 - SDK 설치 (2) - 현재

react native appsflyer deep link 완벽 가이드 - OneLink (3)

react native appsflyer deep link 완벽 가이드 - 코드 (4)

react-native-appsflyer 설치

Installation

yarn add react-native-appsflyer

npx pod-install ios

Android - Deep Link 설정

appsflyer-react-native-plugin/Docs/RN_DeepLinkIntegrate.md at master · AppsFlyerSDK/appsflyer-react-native-plugin

// android/app/src/main/java/com/appsflyer_deep_link_app/MainActivity.kt

import android.os.Bundle
import android.content.Intent // add this
...

override fun onCreate(savedInstanceState: Bundle?) {
  super.onCreate(null)
}

// add this
override fun onNewIntent(intent: Intent) {
  super.onNewIntent(intent)
  setIntent(intent)
}
<!-- android/app/src/main/AndroidManifest.xml -->

<manifest xmlns:android="<http://schemas.android.com/apk/res/android>" xmlns:tools="<http://schemas.android.com/tools>" package="com.appsflyer_deep_link">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />

    <application
      tools:replace="android:allowBackup"
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      android:supportsRtl="true">
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" android:host="appsflyer-deep-link.onelink.me" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="appsflyer-deep-link" />
        </intent-filter>
      </activity>
    </application>
</manifest>

Android - Package Name 변경

스크린샷 2025-03-12 오전 10.48.21.png

<변경 전>

<변경 전>

<변경 후>

<변경 후>