Skip to content

Commit

Permalink
docs(rudder_integration_appsflyer_flutter): updated readme file to in…
Browse files Browse the repository at this point in the history
…clude platform specific steps to be taken
  • Loading branch information
Desu Sai Venkat committed Apr 5, 2023
1 parent 9f43689 commit df06325
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,40 @@ rudderClient.initialize(WRITE_KEY,
config: builder.build(), options:null);
```

5. Add the below dependency to the `android/app/build.gradle` file of your app:

```groovy
dependencies {
implementation 'com.appsflyer:af-android-sdk:6.+'
}
```

6. And then initialize the Appsflyer Android SDK by overriding the `onCreate` method in `MainActivity.java` file located at your app's `android/app/src/main/java/com/your_org/your_app_name/` folder, so that the Appsflyer's Android SDK is initialized even before the Rudderstack's RN SDK and is made available for the RN SDK.

```java

import com.appsflyer.AppsFlyerLib;
import com.appsflyer.AFLogger;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AppsFlyerLib.getInstance().init("AF_DEV_KEY", null, this);
AppsFlyerLib.getInstance().setLogLevel(AFLogger.LogLevel.DEBUG);
AppsFlyerLib.getInstance().start(this);
}
```

7. And then initalize the Appsflyer iOS SDK by adding the below code at the top of the `didFinishLaunchingWithOptions` method in the `AppDelegate.swift` file located at your app's `ios/Runner/` folder.

```swift
import AppsFlyerLib

AppsFlyerLib.shared().appsFlyerDevKey = "AF_DEV_KEY"
AppsFlyerLib.shared().appleAppID = "APPLE_APP_ID"
AppsFlyerLib.shared().isDebug = true
AppsFlyerLib.shared().start()
```
## Sending Events

Follow the steps from our [RudderStack Flutter SDK](https://github.com/rudderlabs/rudder-sdk-flutter#send-events) repo.
Expand Down

0 comments on commit df06325

Please sign in to comment.