Skip to content

Commit

Permalink
Added DeepLink API
Browse files Browse the repository at this point in the history
Updated SDK to 4.7.4 Android 4.7.11 iOS
Re-enabled enableUninstallTracking
Updated Docs
  • Loading branch information
BenjaminAF committed Jul 2, 2017
1 parent 785a729 commit ef67d27
Show file tree
Hide file tree
Showing 82 changed files with 1,197 additions and 32 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
36 changes: 28 additions & 8 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ In order for us to provide optimal support, we would kindly ask you to submit an
- [onInstallConversionData](#appsflyeroninstallconversiondatacallback-functionunregister)
- [getAppsFlyerUID](#appsflyergetappsflyeruidcallback-void)
- [trackLocation (ios only)](#appsflyertracklocationlongitude-latitude-callbackerror-coords-void-ios-only)
- [sendDeepLinkData (Android only)](#senddeeplinkdata-android-only)
- [Demo](#demo)


Expand Down Expand Up @@ -277,7 +278,7 @@ Read more about Uninstall register: [Appsflyer SDK support site](https://support

#### <a id="track-app-uninstalls-android"> Android

`setGCMProjectID(GCMProjectID): void`
`enableUninstallTracking(GCMProjectID): void`

Set the GCM API key. AppsFlyer requires a Google Project Number and GCM API Key to enable uninstall tracking.

Expand All @@ -289,14 +290,11 @@ Set the GCM API key. AppsFlyer requires a Google Project Number and GCM API Key

```javascript

setGCMProjectID(){
const gcmProjectId = "987186475229";
appsFlyer.setGCMProjectID(gcmProjectId,
(gcmProjectID) => {
enableUninstallTracking(){
const gcmProjectNum = "987186475229";
appsFlyer.enableUninstallTracking(gcmProjectNum,
(success) => {
//...
},
(error) => {
console.error(error);
})
}

Expand Down Expand Up @@ -415,6 +413,28 @@ appsFlyer.trackLocation(longitude, latitude, (error, coords) => {

---

#### <a id="senddeeplinkdata-android-only"> **`appsFlyer.sendDeepLinkData(String url): void`**

Report Deep Links for Re-Targeting Attribution (Android).
This method should be called when an app is opened using a deep link.

*Example:*
```javascript
componentDidMount() {
Linking.getInitialURL().then((url) => {
if (appsFlyer) {
appsFlyer.sendDeepLinkData(url); // Report Deep Link to AppsFlyer
// Additional Deep Link Logic Here ...
}
}).catch(err => console.error('An error occurred', err));
}
```

More about Deep Links in React-Native: [React-Native Linking](https://facebook.github.io/react-native/docs/linking.html)
More about Deep Links in Android: [Android Deep Linking , Adding Filters](https://developer.android.com/training/app-indexing/deep-linking.html#adding-filters)

---

##### <a id="setUserEmails"> **`appsFlyer.setUserEmails(options, errorC, successC): void`**

AppsFlyer enables you to report one or more of the device’s associated email addresses. You must collect the email addresses and report it to AppsFlyer according to your required encryption method.
Expand Down
Empty file modified android/build.gradle
100644 → 100755
Empty file.
Empty file modified android/src/main/AndroidManifest.xml
100644 → 100755
Empty file.
Empty file.
39 changes: 26 additions & 13 deletions android/src/main/java/com/appsflyer/reactnative/RNAppsFlyerModule.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

import android.content.Context;
import android.util.Log;
import android.content.Intent;
import android.net.Uri;


import org.json.JSONArray;
import org.json.JSONException;
Expand Down Expand Up @@ -223,6 +226,16 @@ public void trackEvent(
}
}

@ReactMethod
public void sendDeepLinkData(String url) {
if (url != null) {
Intent intent = getCurrentActivity().getIntent();
Uri uri = Uri.parse(url);
intent.setData(uri);
AppsFlyerLib.getInstance().sendDeepLinkData(this.getCurrentActivity());
}
}


@Deprecated
@ReactMethod
Expand All @@ -246,19 +259,19 @@ public void setGCMProjectNumber(final String gcmProjectNumber,
successCallback.invoke(SUCCESS);
}

// @ReactMethod
// public void enableUninstallTracking(final String gcmProjectNumber,
// Callback successCallback)
// {
// AppsFlyerLib.getInstance().enableUninstallTracking(gcmProjectNumber);
// successCallback.invoke(SUCCESS);
// }
//
// @ReactMethod
// public void updateServerUninstallToken(final String token,Callback callback){
// AppsFlyerLib.getInstance().updateServerUninstallToken(getReactApplicationContext(), token);
// callback.invoke(SUCCESS);
// }
@ReactMethod
public void enableUninstallTracking(final String gcmProjectNumber,
Callback successCallback)
{
AppsFlyerLib.getInstance().enableUninstallTracking(gcmProjectNumber);
successCallback.invoke(SUCCESS);
}

@ReactMethod
public void updateServerUninstallToken(final String token,Callback callback){
AppsFlyerLib.getInstance().updateServerUninstallToken(getReactApplicationContext(), token);
callback.invoke(SUCCESS);
}

@ReactMethod
public void setCustomerUserId(final String userId,Callback callback){
Expand Down
Empty file.
Empty file modified android/src/main/java/com/appsflyer/reactnative/RNUtil.java
100644 → 100755
Empty file.
Binary file modified android/src/main/libs/AF-Android-SDK.jar
Binary file not shown.
Empty file modified demo/.babelrc
100644 → 100755
Empty file.
Empty file modified demo/.buckconfig
100644 → 100755
Empty file.
Empty file modified demo/.flowconfig
100644 → 100755
Empty file.
Empty file modified demo/.gitattributes
100644 → 100755
Empty file.
Empty file modified demo/.gitignore
100644 → 100755
Empty file.
Empty file modified demo/.watchmanconfig
100644 → 100755
Empty file.
Empty file modified demo/__tests__/index.android.js
100644 → 100755
Empty file.
Empty file modified demo/__tests__/index.ios.js
100644 → 100755
Empty file.
Empty file modified demo/android/app/BUCK
100644 → 100755
Empty file.
Empty file modified demo/android/app/build.gradle
100644 → 100755
Empty file.
Empty file modified demo/android/app/proguard-rules.pro
100644 → 100755
Empty file.
4 changes: 4 additions & 0 deletions demo/android/app/src/main/AndroidManifest.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="native_deeplink" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
Expand Down
Empty file modified demo/android/app/src/main/java/com/demo/MainActivity.java
100644 → 100755
Empty file.
Empty file modified demo/android/app/src/main/java/com/demo/MainApplication.java
100644 → 100755
Empty file.
Empty file modified demo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified demo/android/app/src/main/res/values/strings.xml
100644 → 100755
Empty file.
Empty file modified demo/android/app/src/main/res/values/styles.xml
100644 → 100755
Empty file.
Empty file modified demo/android/build.gradle
100644 → 100755
Empty file.
Empty file modified demo/android/gradle.properties
100644 → 100755
Empty file.
Empty file modified demo/android/gradle/wrapper/gradle-wrapper.jar
100644 → 100755
Empty file.
Empty file modified demo/android/gradle/wrapper/gradle-wrapper.properties
100644 → 100755
Empty file.
Empty file modified demo/android/gradlew.bat
100644 → 100755
Empty file.
Empty file modified demo/android/keystores/BUCK
100644 → 100755
Empty file.
Empty file modified demo/android/keystores/debug.keystore.properties
100644 → 100755
Empty file.
Empty file modified demo/android/settings.gradle
100644 → 100755
Empty file.
Empty file modified demo/demo_example.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions demo/index.android.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
AppRegistry,
StyleSheet,
Text,
View
View,
Linking
} from 'react-native';

export default class demo extends Component {
Expand All @@ -36,7 +37,14 @@ export default class demo extends Component {
}



// Handle DeepLink URL
componentDidMount() {
Linking.getInitialURL().then((url) => {
if (appsFlyer) {
appsFlyer.sendDeepLinkData(url); // Report Deep Link to AppsFlyer
}
}).catch(err => console.error('An error occurred', err));
}


initSdk(){
Expand All @@ -61,7 +69,7 @@ export default class demo extends Component {

appsFlyer.enableUninstallTracking(gcmProjectNumber,
(gcmProjectID) => {
this.setState( { ...this.state, gcmProjectNumberResponse: gcmProjectID });
this.setState( { ...this.state, gcmProjectNumberResponse: gcmProjectID });
})
}

Expand Down
Empty file modified demo/index.base.js
100644 → 100755
Empty file.
Empty file modified demo/index.ios.js
100644 → 100755
Empty file.
Empty file modified demo/ios/Podfile
100644 → 100755
Empty file.
12 changes: 12 additions & 0 deletions demo/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PODS:
- AppsFlyerFramework (4.7.11)

DEPENDENCIES:
- AppsFlyerFramework

SPEC CHECKSUMS:
AppsFlyerFramework: ece902d4233177d4e9db1429c7a5df5fad8e9f07

PODFILE CHECKSUM: b3e1d386f200061ce24cf0d60bca964b593d5588

COCOAPODS: 1.2.0

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading

0 comments on commit ef67d27

Please sign in to comment.