Skip to content

Commit

Permalink
Merge pull request #178 from AppsFlyerSDK/dev/sdk-v6-beta
Browse files Browse the repository at this point in the history
dev/sdk-v6-beta
  • Loading branch information
sokoloff06 committed Sep 3, 2020
2 parents 1714227 + 0b5e7d8 commit c6af785
Show file tree
Hide file tree
Showing 87 changed files with 1,960 additions and 1,655 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/appsflyer-issue-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ e.g. Run `pod install`
## What did you expect to happen?

ℹ Please replace these two lines with what you expected to happen.
e.g. Event to be tracked
e.g. Event to be logged

## What happened instead?

Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/examples
/SampleApp
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Versions

## 6.0.20

- iOS SDK 6.0.2

_APIs renamed:_

| Old API | New API |
| ------------------------------|-------------------------------|
| trackEvent | logEvent |
| trackLocation | logLocation |
| stopTracking | stop |
| trackCrossPromotionImpression | logCrossPromotionImpression |
| trackAndOpenStore | logCrossPromotionAndOpenStore |
| setDeviceTrackingDisabled | anonymizeUser |
| disableAdvertiserIdentifier | disableAdvertisingIdentifier |


_APIs removed:_

- trackAppLaunch
- enableUninstallTracking
- sendDeepLinkData


## 5.4.40
- Android SDK v5.4.3
- iOS SDK v5.4.4
Expand Down
82 changes: 25 additions & 57 deletions Docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@
- [appId](#appId)
- [onInstallConversionData](#onInstallConversionData)
- [onAppOpenAttribution](#onAppOpenAttribution)
- [trackEvent](#trackEvent)
- [logEvent](#logEvent)
- [setCustomerUserId](#setCustomerUserId)
- [getAppsFlyerUID](#getAppsFlyerUID)
- [stopTracking](#stopTracking)
- [trackLocation](#trackLocation)
- [stop](#stop)
- [logLocation](#logLocation)
- [setUserEmails](#setUserEmails)
- [setAdditionalData](#setAdditionalData)
- [sendDeepLinkData](#sendDeepLinkData)
- [setAdditionalData](#setAdditionalData)
- [updateServerUninstallToken](#updateServerUninstallToken)
- [setCollectIMEI](#setCollectIMEI)
- [setCollectAndroidID](#setCollectAndroidID)
- [setAppInviteOneLinkID](#setAppInviteOneLinkID)
- [generateInviteLink](#generateInviteLink)
- [trackCrossPromotionImpression](#trackCrossPromotionImpression)
- [trackAndOpenStore](#trackAndOpenStore)
- [logCrossPromotionImpression](#logCrossPromotionImpression)
- [logCrossPromotionAndOpenStore](#logCrossPromotionAndOpenStore)
- [setCurrencyCode](#setCurrencyCode)
- [setDeviceTrackingDisabled](#setDeviceTrackingDisabled)
- [anonymizeUser](#anonymizeUser)
- [setOneLinkCustomDomains](#setOneLinkCustomDomains)
- [setResolveDeepLinkURLs](#setResolveDeepLinkURLs)
- [performOnAppAttribution](#performOnAppAttribution)
- [setSharingFilterForAllPartners](#setSharingFilterForAllPartners)
- [setSharingFilter](#setSharingFilter)
- [disableCollectASA](#disableCollectASA)
- [disableAdvertiserIdentifier](#disableAdvertiserIdentifier)
- [disableAdvertisingIdentifier](#disableAdvertisingIdentifier)

---

Expand Down Expand Up @@ -182,7 +181,7 @@ appsFlyer.initSdk(/*...*/);
---
##### <a id="trackEvent"> **`trackEvent(eventName, eventValues, success, error)`**
##### <a id="logEvent"> **`logEvent(eventName, eventValues, success, error)`**
In-App Events provide insight on what is happening in your app. It is recommended to take the time and define the events you want to measure to allow you to measure ROI (Return on Investment) and LTV (Lifetime Value).
Expand All @@ -207,7 +206,7 @@ const eventValues = {
af_revenue: '2',
};

appsFlyer.trackEvent(
appsFlyer.logEvent(
eventName,
eventValues,
(res) => {
Expand Down Expand Up @@ -266,7 +265,7 @@ appsFlyer.getAppsFlyerUID((err, appsFlyerUID) => {
---
##### <a id="stopTracking"> **`stopTracking(isStopTracking, callback)`**
##### <a id="stop"> **`stop(isStopped, callback)`**
In some extreme cases you might want to shut down all SDK functions due to legal and privacy compliance. This can be achieved with the stopSDK API. Once this API is invoked, our SDK no longer communicates with our servers and stops functioning.
Expand All @@ -276,21 +275,21 @@ In any event, the SDK can be reactivated by calling the same API, by passing fal
| parameter | type | description |
| ---------- |----------|------------------ |
| isStopTracking | boolean | True if the SDK is stopped (default value is false). |
| isStopped | boolean | True if the SDK is stopped (default value is false). |
| callback | function | success callback |
*Example:*
```javascript
appsFlyer.stopTracking(true, (res) => {
appsFlyer.stop(true, (res) => {
//...
});
```
---
##### <a id="trackLocation"> **`trackLocation(longitude, latitude, callback)`**
##### <a id="logLocation"> **`logLocation(longitude, latitude, callback)`**
Manually record the location of the user.
Expand All @@ -307,7 +306,7 @@ Manually record the location of the user.
const latitude = -18.406655;
const longitude = 46.40625;

appsFlyer.trackLocation(longitude, latitude, (err, coords) => {
appsFlyer.logLocation(longitude, latitude, (err, coords) => {
if (err) {
console.error(err);
} else {
Expand Down Expand Up @@ -383,37 +382,6 @@ appsFlyer.setAdditionalData(
---
##### <a id="sendDeepLinkData"> **`sendDeepLinkData(callback)`**
(Android only)
Report Deep Links for Re-Targeting Attribution (Android). This method should be called when an app is opened using a deep link.
| parameter | type | description |
| ---------- |----------|------------------ |
| callback | function | success callback |
*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).<br/>
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="updateServerUninstallToken"> **`updateServerUninstallToken(token, callback)`**
(Android only)
Expand Down Expand Up @@ -542,7 +510,7 @@ A complete list of supported parameters is available [here](https://support.apps
---
##### <a id="trackCrossPromotionImpression"> **`trackCrossPromotionImpression(appId, campaign)`**
##### <a id="logCrossPromotionImpression"> **`logCrossPromotionImpression(appId, campaign)`**
To attribute an impression use the following API call.<br/>
Make sure to use the promoted App ID as it appears within the AppsFlyer dashboard.
Expand All @@ -557,14 +525,14 @@ Make sure to use the promoted App ID as it appears within the AppsFlyer dashboar
*Example:*
```javascript
appsFlyer.trackCrossPromotionImpression("com.myandroid.app", "myCampaign");
appsFlyer.logCrossPromotionImpression("com.myandroid.app", "myCampaign");
```
For more details about Cross-Promotion tracking please see the relevent doc [here](https://support.appsflyer.com/hc/en-us/articles/115004481946-Cross-Promotion-Tracking).
For more details about Cross-Promotion logging please see the relevent doc [here](https://support.appsflyer.com/hc/en-us/articles/115004481946-Cross-Promotion-Tracking).
---
##### <a id="trackAndOpenStore"> **`trackAndOpenStore(appId, campaign, params)`**
##### <a id="logCrossPromotionAndOpenStore"> **`logCrossPromotionAndOpenStore(appId, campaign, params)`**
Use the following API to attribute the click and launch the app store's app page.
Expand All @@ -583,7 +551,7 @@ var crossPromOptions = {
myCustomParameter: 'newUser',
};

appsFlyer.trackAndOpenStore(
appsFlyer.logCrossPromotionAndOpenStore(
'com.myandroid.app',
'myCampaign',
crossPromOptions
Expand Down Expand Up @@ -612,22 +580,22 @@ appsFlyer.setCurrencyCode(currencyCode, () => {});
---
##### <a id="setDeviceTrackingDisabled"> **`setDeviceTrackingDisabled(isDeviceTrackingDisabled, callback)`**
##### <a id="anonymizeUser"> **`anonymizeUser(shouldAnonymize, callback)`**
It is possible to anonymize specific user identifiers within AppsFlyer analytics.<br/>
This complies with both the latest privacy requirements (GDPR, COPPA) and Facebook's data and privacy policies.<br/>
To anonymize an app user:<br/>
| parameter | type | description |
| ---------- |----------|------------------ |
| isDeviceTrackingDisabled | boolean | True if want Anonymize user Data (default value is false). |
| shouldAnonymize | boolean | True if want Anonymize user Data (default value is false). |
| callback | function | success callback |
*Example:*
```javascript
appsFlyer.setDeviceTrackingDisabled(true, () => {});
appsFlyer.anonymizeUser(true, () => {});
```
---
Expand Down Expand Up @@ -753,7 +721,7 @@ appsFlyer.disableCollectASA(true);
---
##### <a id="disableAdvertiserIdentifier"> **`disableAdvertiserIdentifier(shouldDisable)`**
##### <a id="disableAdvertisingIdentifier"> **`disableAdvertisingIdentifier(shouldDisable)`**
(iOS only)
Expand All @@ -766,7 +734,7 @@ Disables IDFA collecting
*Example:*
```javascript
appsFlyer.disableAdvertiserIdentifier(true);
appsFlyer.disableAdvertisingIdentifier(true);
```
---
34 changes: 17 additions & 17 deletions Docs/Guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
- [Direct Deep Linking](#direct-deep-linking)
- [iOS Deeplink Setup](#iosdeeplinks)
- [Android Deeplink Setup](#android-deeplinks)
- [Uninstall](#track-app-uninstalls)
- [iOS Uninstall Setup](#track-app-uninstalls-ios)
- [Android Uninstall Setup](#track-app-uninstalls-android)
- [Uninstall](#measure-app-uninstalls)
- [iOS Uninstall Setup](#measure-app-uninstalls-ios)
- [Android Uninstall Setup](#measure-app-uninstalls-android)


## <a id="init-sdk"> Init SDK
Expand Down Expand Up @@ -236,22 +236,22 @@ const Home = (props) => {

### <a id="iosdeeplinks"> iOS Deep Links - Universal Links and URL Schemes

In order to track retargeting and use the onAppOpenAttribution callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file:
In order to record retargeting and use the onAppOpenAttribution callbacks in iOS, the developer needs to pass the User Activity / URL to our SDK, via the following methods in the **AppDelegate.m** file:

#### import
```objectivec
#import <React/RCTLinkingManager.h>
#if __has_include(<AppsFlyerLib/AppsFlyerTracker.h>) // from Pod
#import <AppsFlyerLib/AppsFlyerTracker.h>
#if __has_include(<AppsFlyerLib/AppsFlyerLib.h>) // from Pod
#import <AppsFlyerLib/AppsFlyerLib.h>
#else
#import "AppsFlyerTracker.h"
#import "AppsFlyerLib.h"
#endif
```

#### Universal Links (iOS 9 +)
```objectivec
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
[[AppsFlyerTracker sharedTracker] continueUserActivity:userActivity restorationHandler:restorationHandler];
[[AppsFlyerLib shared] continueUserActivity:userActivity restorationHandler:restorationHandler];
return YES;
}
```
Expand All @@ -260,14 +260,14 @@ In order to track retargeting and use the onAppOpenAttribution callbacks in iOS,
```objectivec
// Reports app open from deep link from apps which do not support Universal Links (Twitter) and for iOS8 and below
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString*)sourceApplication annotation:(id)annotation {
[[AppsFlyerTracker sharedTracker] handleOpenURL:url sourceApplication:sourceApplication withAnnotation:annotation];
[[AppsFlyerLib shared] handleOpenURL:url sourceApplication:sourceApplication withAnnotation:annotation];
return YES;
}
// Reports app open from URL Scheme deep link for iOS 10
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
options:(NSDictionary *) options {
[[AppsFlyerTracker sharedTracker] handleOpenUrl:url options:options];
[[AppsFlyerLib shared] handleOpenUrl:url options:options];
return YES;
}
```
Expand All @@ -294,13 +294,13 @@ This method makes sure that you get the latest deep link data even if the app wa

---

### <a id="track-app-uninstalls"> Track App Uninstalls
### <a id="measure-app-uninstalls"> Measure App Uninstalls

#### <a id="track-app-uninstalls-ios"> iOS
#### <a id="measure-app-uninstalls-ios"> iOS

#### First method

AppsFlyer enables you to track app uninstalls. To handle notifications it requires to modify your `AppDelegate.m`. Use [didRegisterForRemoteNotificationsWithDeviceToken](https://developer.apple.com/reference/uikit/uiapplicationdelegate) to register to the uninstall feature.
AppsFlyer enables you to measure app uninstalls. To handle notifications it requires to modify your `AppDelegate.m`. Use [didRegisterForRemoteNotificationsWithDeviceToken](https://developer.apple.com/reference/uikit/uiapplicationdelegate) to register to the uninstall feature.

*Example:*

Expand All @@ -310,8 +310,8 @@ AppsFlyer enables you to track app uninstalls. To handle notifications it requir
...

- (void)application:(UIApplication ​*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *​)deviceToken {
// notify AppsFlyerTracker
[[AppsFlyerTracker sharedTracker] registerUninstall:deviceToken];
// notify AppsFlyerLib
[[AppsFlyerLib shared] registerUninstall:deviceToken];
}
```

Expand All @@ -329,7 +329,7 @@ appsFlyer.updateServerUninstallToken(deviceToken, (success) => {
});
```

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

Update Firebase device token so it can be sent to AppsFlyer

Expand All @@ -341,5 +341,5 @@ appsFlyer.updateServerUninstallToken(newFirebaseToken, (success) => {
});
```

Read more about Android Uninstall Tracking: [Appsflyer SDK support site](https://support.appsflyer.com/hc/en-us/articles/208004986-Android-Uninstall-Tracking)
Read more about Android Uninstall Measurement: [Appsflyer SDK support site](https://support.appsflyer.com/hc/en-us/articles/208004986-Android-Uninstall-Tracking)

Loading

0 comments on commit c6af785

Please sign in to comment.